// Event method for 'DroneClient.NavigationPacketAcquired' action private void NavigationDataAcquired(NavigationData aPacket) { if (Active) { var data = new Apparatus.Output { Navigation = aPacket, LastInput = LastInput }; EnqueueOutput(data); } }
public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput) { float heading = CorrectRotation(aApparatusOutput.Navigation.Yaw); aApparatusInput.Yaw = Arithmetics.KeepInRange(CorrectRotation((Value) - (heading))*Agression, Input.Limits.Yaw.Min, Input.Limits.Yaw.Max); if (CanBeObtained) { if (Math.Abs(aApparatusInput.Yaw) < 0.05) _obtainCandidates++; else _obtainCandidates = 0; if (_obtainCandidates > 3) Obtained = true; } }
public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput) { aApparatusInput.Command = Input.Type.Land; }
public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput) { aApparatusInput.Gaz = Arithmetics.KeepInRange(Value, Input.Limits.Gaz.Min, Input.Limits.Gaz.Max); }
public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput) { aApparatusInput.Command = Input.Type.ResetEmergency; Obtained = true; }
public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput) { aApparatusInput.Command = Input.Type.FlatTrim; Obtained = true; }
/// <summary> /// Enqueue drone's output data for autopilot handling based on current objective. /// </summary> /// <param name="aData">Output data to be enqueued</param> public void EnqueueOutput(Apparatus.Output aData) { ApparatusOutputQueue.Enqueue(aData); }
public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput) { float altitude = Arithmetics.KeepInRange(aApparatusOutput.Navigation.Altitude, Min, Max); aApparatusInput.Gaz = Arithmetics.KeepInRange(Diff(altitude)*Agression, Input.Limits.Gaz.Min, Input.Limits.Gaz.Max); }
public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput) { aApparatusInput.Pitch = -CalculateVelocityManeuver(aApparatusOutput.Navigation.Velocity.X); }
public abstract void Contribute(Output aApparatusOutput, ref Input aApparatusInput);
// Event method for 'DroneClient.NavigationPacketAcquired' action private void NavigationDataAcquired(NavigationData aPacket) { if (Active) { var data = new Apparatus.Output {Navigation = aPacket, LastInput = LastInput}; EnqueueOutput(data); } }