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(); }
/// <summary> /// 重写关闭代码 /// 将开启的资源关闭 /// </summary> /// <param name="e"></param> /// <returns></returns> protected override void OnClosed(EventArgs e) { if (_autopilot != null) { _autopilot.UnbindFromClient(); _autopilot.Stop(); } StopRecording(); _droneClient.Dispose(); if (_videoPacketDecoderWorker != null) { _videoPacketDecoderWorker.Dispose(); } _viconPositionGet.Dispose(); if (_pwrite != null) { _pwrite.Stop(); _pwrite.Join(); _pwrite.Dispose(); } if (_viconPositionGet != null) { _viconPositionGet.Dispose(); } base.OnClosed(e); }
// Called if the gameobject is destroyed void OnDestroy() { droneClient.Land(); droneClient.Stop(); droneClient.Dispose(); videoPacketDecoderWorker.Stop(); videoPacketDecoderWorker.Dispose(); }
protected override void OnClosed(EventArgs e) { droneClient.Stop(); droneClient.Dispose(); videoPacketDecoderWorker.Dispose(); base.OnClosed(e); }
protected override void OnClosed(EventArgs e) { _droneClient.Dispose(); _videoPacketDecoderWorker.Dispose(); _packetRecorderWorker.Dispose(); base.OnClosed(e); }
protected override void UnloadContent() { droneClient.Dispose(); videoPacketDecoderWorker.Dispose(); if (kinect != null) { kinect.Dispose(); } }
public override void Cleanup() { base.Cleanup(); _droneClient.Stop(); _droneClient.Dispose(); _videoPacketDecoderWorker.Dispose(); _autopilot.Stop(); }
protected override void OnClosed(EventArgs e) { if (_autopilot != null) { _autopilot.UnbindFromClient(); _autopilot.Stop(); } StopRecording(); _droneClient.Dispose(); _videoPacketDecoderWorker.Dispose(); base.OnClosed(e); }
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(); }
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); }
void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { _droneClient.Dispose(); _videoPacketDecoderWorker.Dispose(); }