Ejemplo n.º 1
0
        public override void Cleanup()
        {
            base.Cleanup();

            _droneClient.Stop();
            _droneClient.Dispose();
            _videoPacketDecoderWorker.Dispose();
            _autopilot.Stop();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var droneClient = new DroneClient("192.168.1.1");

            SleepAndPaint(droneClient);

            droneClient.Start();

            SleepAndPaint(droneClient);

            droneClient.Takeoff();

            SleepAndPaint(droneClient);


            droneClient.Progress(FlightMode.Progressive, yaw: -0.05f);

            System.Console.WriteLine("Yaw -0.05");
            SleepAndPaint(droneClient);

            droneClient.Hover();
            SleepAndPaint(droneClient);

            droneClient.Land();

            SleepAndPaint(droneClient);

            droneClient.Stop();

            SleepAndPaint(droneClient);

            System.Console.ReadLine();

            droneClient.Dispose();
        }
Ejemplo n.º 3
0
 // Called if the gameobject is destroyed
 void OnDestroy()
 {
     droneClient.Land();
     droneClient.Stop();
     droneClient.Dispose();
     videoPacketDecoderWorker.Stop();
     videoPacketDecoderWorker.Dispose();
 }
Ejemplo n.º 4
0
        protected override void OnClosed(EventArgs e)
        {
            droneClient.Stop();
            droneClient.Dispose();
            videoPacketDecoderWorker.Dispose();

            base.OnClosed(e);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Deactivates the drone
 /// </summary>
 /// <returns>Boolean Value whether the command works properly</returns>
 public bool Stop()
 {
     try
     {
         _client.Stop();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 6
0
        private void MainForm2_KeyUp(object sender, KeyEventArgs e)
        {
            // If escape is pressed, quit the application.
            if (e.KeyCode == Keys.Escape)
            {
                drone.Land();
                drone.Stop();

                Application.Exit();
            }
            else if (e.KeyCode == Keys.Space)
            {
                drone.Land();
            }
        }
Ejemplo n.º 7
0
 private async void MainWindow_Closed(object sender, EventArgs e)
 {
     if (frameTimer != null)
     {
         frameTimer.Stop();
     }
     if (droneClient != null)
     {
         droneClient.Stop();
         droneClient.Dispose();
     }
     if (videoPacketDecoderWorker != null)
     {
         videoPacketDecoderWorker.Stop();
         videoPacketDecoderWorker.Dispose();
     }
     await closeSource();
 }
Ejemplo n.º 8
0
        void configDrone()
        {
            if (droneClient != null)
            {
                droneClient.VideoPacketAcquired -= OnVideoPacketAcquired;
            }
            droneClient?.Stop();
            droneClient?.Dispose();
            iotController = null;
            autoPilot?.Stop();
            autoPilot = null;
            videoPacketDecoderWorker?.Stop();
            videoPacketDecoderWorker?.Dispose();

            Logger.LogInfo($"Configuring Drone at {config.DroneIP}");
            droneClient = new DroneClient(config.DroneIP);
            droneClient.VideoPacketAcquired += OnVideoPacketAcquired;
            videoPacketDecoderWorker         = new VideoPacketDecoderWorker(AR.Drone.Video.PixelFormat.BGR24, true, OnVideoPacketDecoded);
            videoPacketDecoderWorker.Start();

            iotController = new IoTHubController(droneClient, analyzerOutput, bitmaps);
            autoPilot     = new Pilot.Controller(droneClient, analyzerOutput, config, iotController);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// This method will stop the drone
 /// The given time is the threading wait time
 /// </summary>
 /// <param name="time"></param>
 public void Stop(int time)
 {
     Console.WriteLine("Stop");
     _droneClient.Stop();
     System.Threading.Thread.Sleep(time);
 }
 void btnDeActivate_Click(object sender, RoutedEventArgs e)
 {
     _droneClient.Stop();
 }
Ejemplo n.º 11
0
 private void btnStop_Click(object sender, EventArgs e)
 {
     _droneClient.Stop();
 }
Ejemplo n.º 12
0
 public void Stop()
 {
     droneClient.Land();
     droneClient.Stop();
 }
Ejemplo n.º 13
0
 public void Stop()
 {
     _commandReceiver.Stop();
     _client.Stop();
 }
Ejemplo n.º 14
0
 public void Stop()
 {
     _client.Stop();
 }