void GestureDetection_LeftHandBackForwardsChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Center: break; case HandPosition.Backwards: if (_client.NavigationData.State == (NavigationState.Landed | NavigationState.Command)) { _client.FlatTrim(); } DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Flat Trim " }); break; case HandPosition.Forwards: _client.Hover(); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Hover" }); break; } }
void GestureDetection_RightHandUpDownChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Up: _client.Progress(FlightMode.Progressive, gaz: 0.25f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Going Up" }); break; case HandPosition.Center: break; case HandPosition.Down: _client.Progress(FlightMode.Progressive, gaz: -0.25f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Going Down" }); break; } }
void GestureDetection_LeftHandUpDownChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Up: _client.Takeoff(); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Taking Off" }); break; case HandPosition.Center: break; case HandPosition.Down: _client.Land(); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Landing" }); break; } }
void GestureDetection_RightHandLeftRightChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Center: break; case HandPosition.Left: _client.Progress(FlightMode.Progressive, roll: -0.05f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Rolling to the Left" }); break; case HandPosition.Right: _client.Progress(FlightMode.Progressive, roll: 0.05f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Rolling to the Right" }); break; } }
void GestureDetection_LeftHandLeftRightChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Center: break; case HandPosition.Left: _client.Progress(FlightMode.Progressive, yaw: 0.25f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Turning Left" }); break; case HandPosition.Right: _client.Progress(FlightMode.Progressive, yaw: -0.25f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Turning Right" }); break; } }
void GestureDetection_RightHandBackForwardsChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Center: break; case HandPosition.Backwards: _client.Progress(FlightMode.Progressive, pitch: 0.05f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Moving Backwards" }); break; case HandPosition.Forwards: _client.Progress(FlightMode.Progressive, pitch: -0.05f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Moving Forwards" }); break; } }
void OnLeftHandBackFordwardChanged(object sender, HandPositionChangedArgs args) { LeftFordwardsButton.IsEnabled = args.Position == HandPosition.Forwards; LeftCenter3Button.IsEnabled = args.Position == HandPosition.Center; LeftBackwardsButton.IsEnabled = args.Position == HandPosition.Backwards; }
void OnLeftHandLeftRightChanged(object sender, HandPositionChangedArgs args) { LeftLeftButton.IsEnabled = args.Position == HandPosition.Left; LeftCenter2Button.IsEnabled = args.Position == HandPosition.Center; LeftRightButton.IsEnabled = args.Position == HandPosition.Right; }
void OnLeftHandUpDownChanged(object sender, HandPositionChangedArgs args) { LeftUpButton.IsEnabled = args.Position == HandPosition.Up; LeftCenter1Button.IsEnabled = args.Position == HandPosition.Center; LeftDownButton.IsEnabled = args.Position == HandPosition.Down; }
void OnRightHandUpDownChanged(object sender, HandPositionChangedArgs args) { RightUpButton.IsEnabled = args.Position == HandPosition.Up; RightCenter1Button.IsEnabled = args.Position == HandPosition.Center; RightDownButton.IsEnabled = args.Position == HandPosition.Down; }
void OnRightHandLeftRightChanged(object sender, HandPositionChangedArgs args) { RightLeftButton.IsEnabled = args.Position == HandPosition.Left; RightCenter2Button.IsEnabled = args.Position == HandPosition.Center; RightRightButton.IsEnabled = args.Position == HandPosition.Right; }
void OnRightHandBackFordwardChanged(object sender, HandPositionChangedArgs args) { RightFordwardsButton.IsEnabled = args.Position == HandPosition.Forwards; RightCenter3Button.IsEnabled = args.Position == HandPosition.Center; RightBackwardsButton.IsEnabled = args.Position == HandPosition.Backwards; }