Exemplo n.º 1
0
        public void UpdateDroneController()
        {
            DroneController.Pitch = GetPitchFromKeyboard();
            DroneController.Roll  = GetRollFromKeyboard();
            DroneController.Gaz   = GetGazFromKeyboard();
            DroneController.Yaw   = GetTurnFromKeyboard();

            if (IsKeyPressed(Keys.TakeOffLand))
            {
                if (DroneController.Flying)
                {
                    DroneController.Land();
                }
                else if (DroneController.Connected)
                {
                    DroneController.TakeOff();
                }
            }

            if (IsKeyPressed(Keys.Emergency) && DroneController.Connected)
            {
                DroneController.Emergency();
            }
        }
Exemplo n.º 2
0
 private void Emergency_Click(object sender, RoutedEventArgs e)
 {
     _droneController.Emergency();
 }