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