Пример #1
0
 // Event method for 'DroneClient.NavigationPacketAcquired' action
 private void NavigationDataAcquired(NavigationData aPacket)
 {
     if (Active)
     {
         var data = new Apparatus.Output {
             Navigation = aPacket, LastInput = LastInput
         };
         EnqueueOutput(data);
     }
 }
Пример #2
0
        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;
            }
        }
Пример #3
0
 public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput)
 {
     aApparatusInput.Command = Input.Type.Land;
 }
Пример #4
0
 public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput)
 {
     aApparatusInput.Gaz = Arithmetics.KeepInRange(Value, Input.Limits.Gaz.Min, Input.Limits.Gaz.Max);
 }
Пример #5
0
 public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput)
 {
     aApparatusInput.Command = Input.Type.ResetEmergency;
     Obtained = true;
 }
Пример #6
0
 public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput)
 {
     aApparatusInput.Command = Input.Type.FlatTrim;
     Obtained = true;
 }
Пример #7
0
 /// <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);
 }
Пример #8
0
 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);
 }
Пример #9
0
 public override void Contribute(Output aApparatusOutput, ref Input aApparatusInput)
 {
     aApparatusInput.Pitch = -CalculateVelocityManeuver(aApparatusOutput.Navigation.Velocity.X);
 }
Пример #10
0
 public abstract void Contribute(Output aApparatusOutput, ref Input aApparatusInput);
Пример #11
0
 // Event method for 'DroneClient.NavigationPacketAcquired' action
 private void NavigationDataAcquired(NavigationData aPacket)
 {
     if (Active)
     {
         var data = new Apparatus.Output {Navigation = aPacket, LastInput = LastInput};
         EnqueueOutput(data);
     }
 }