示例#1
0
 public override void Update(float throttle, AircraftPrincipalAxes output)
 {
     _frontMotor.Update(throttle + output.Pitch - output.Yaw);
     _rearMotor.Update(throttle - output.Pitch - output.Yaw);
     _leftMotor.Update(throttle + output.Roll + output.Yaw);
     _rightMotor.Update(throttle - output.Roll + output.Yaw);
 }
 public void Update(AircraftPrincipalAxes gyroAxes, AircraftPrincipalAxes radioAxes, AircraftPrincipalAxes pidAxes, long currentTime)
 {
     _gyroAxes = gyroAxes;
     _radioAxes = radioAxes;
     _pidAxes = gyroAxes;
     _currentTime = currentTime;
 }
 public TelemetryData()
 {
     _gyroAxes = new AircraftPrincipalAxes {Pitch = 0, Roll = 0, Yaw = 0};
     _radioAxes = new AircraftPrincipalAxes { Pitch = 0, Roll = 0, Yaw = 0 };
     _pidAxes = new AircraftPrincipalAxes { Pitch = 0, Roll = 0, Yaw = 0 };
     _currentTime = DateTime.Now.Ticks;
     _buffer = new byte[44];
 }
示例#4
0
 public void Update(AircraftPrincipalAxes radio, AircraftPrincipalAxes gyro, float deltaTimeGain)
 {
     _pitchController.Update(radio.Pitch, gyro.Pitch, deltaTimeGain);
     _rollController.Update(radio.Roll, gyro.Roll, deltaTimeGain);
     _yawController.Update(radio.Yaw, gyro.Yaw, deltaTimeGain);
     Axes.Pitch = _pitchController.Output;
     Axes.Roll = _rollController.Output;
     Axes.Yaw = _yawController.Output;
 }
示例#5
0
 public AxesController(PIDSettings pitchSettings, PIDSettings rollSettings, PIDSettings yawSettings, bool useWindup)
 {
     if (useWindup)
     {
         _pitchController = new PIDWindup(pitchSettings);
         _rollController = new PIDWindup(rollSettings);
         _yawController = new PIDWindup(yawSettings);
     }
     else
     {
         _pitchController = new ControlAlgorithms.Implementations.PID.PID(pitchSettings);
         _rollController = new ControlAlgorithms.Implementations.PID.PID(rollSettings);
         _yawController = new ControlAlgorithms.Implementations.PID.PID(yawSettings);
     }
     Axes = new AircraftPrincipalAxes(){Pitch = 0, Roll = 0, Yaw = 0};
 }
示例#6
0
 public Radio(float throttle, AircraftPrincipalAxes axes, bool gear)
 {
     Throttle = throttle;
     Axes = axes;
     Gear = gear;
 }
 public Accelerometer(AircraftPrincipalAxes axes)
 {
     Axes = axes;
 }
示例#8
0
 public Gyro(AircraftPrincipalAxes axes)
 {
     Axes = axes;
 }
示例#9
0
 public abstract void Update(float throttle, AircraftPrincipalAxes output);
示例#10
0
 public DefaultGyro(AircraftPrincipalAxes axes) : base(axes)
 {
 }