void GestureDetection_RightHandLeftRightChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Center: break; case HandPosition.Left: { _client.Progress(FlightMode.Progressive, roll: -0.1f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Leftwards" }); } break; case HandPosition.Right: { _client.Progress(FlightMode.Progressive, roll: 0.1f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Rightwards" }); } break; } }
void GestureDetection_RightHandBackForwardsChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Center: break; case HandPosition.Backwards: { _client.Progress(FlightMode.Progressive, pitch: 0.1f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Backwards" }); } break; case HandPosition.Forwards: { _client.Progress(FlightMode.Progressive, pitch: -0.1f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Forwards" }); } break; } }
void GestureDetection_LeftHandBackForwardsChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Center: break; case HandPosition.Backwards: if (isLanded) { _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: if (args.MotionState == MotionState.Animation) { if (isFlightEnable) { this.FlightAnimation(this.flightAnimationType); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = this.flightAnimationType.ToString() }); } else { DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Animation Unable" }); } } { _client.Progress(FlightMode.Progressive, gaz: 0.25f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Up" }); } break; case HandPosition.Center: break; case HandPosition.Down: { _client.Progress(FlightMode.Progressive, gaz: -0.25f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Down" }); } break; } }
void GestureDetection_LeftHandUpDownChanged(object sender, HandPositionChangedArgs args) { switch (args.Position) { case HandPosition.Up: if (isLanded) { _client.Takeoff(); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Take Off" }); } else { _client.Land(); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Land" }); } break; case HandPosition.Center: if (args.MotionState == MotionState.Animation) { if (isLedEnable) { LedAnimation(this.ledAnimationType); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = this.ledAnimationType.ToString() }); } } break; case HandPosition.Down: 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 = "Turn Left" }); break; case HandPosition.Right: _client.Progress(FlightMode.Progressive, yaw: -0.25f); DroneCommandChanged(_client, new DroneCommandChangedEventArgs { CommandText = "Turn Right" }); 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; }