Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
        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;
            }
        }
Exemplo n.º 6
0
        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;
            }
        }
Exemplo n.º 7
0
 void OnLeftHandBackFordwardChanged(object sender, HandPositionChangedArgs args)
 {
     LeftFordwardsButton.IsEnabled = args.Position == HandPosition.Forwards;
     LeftCenter3Button.IsEnabled   = args.Position == HandPosition.Center;
     LeftBackwardsButton.IsEnabled = args.Position == HandPosition.Backwards;
 }
Exemplo n.º 8
0
 void OnLeftHandLeftRightChanged(object sender, HandPositionChangedArgs args)
 {
     LeftLeftButton.IsEnabled    = args.Position == HandPosition.Left;
     LeftCenter2Button.IsEnabled = args.Position == HandPosition.Center;
     LeftRightButton.IsEnabled   = args.Position == HandPosition.Right;
 }
Exemplo n.º 9
0
 void OnLeftHandUpDownChanged(object sender, HandPositionChangedArgs args)
 {
     LeftUpButton.IsEnabled      = args.Position == HandPosition.Up;
     LeftCenter1Button.IsEnabled = args.Position == HandPosition.Center;
     LeftDownButton.IsEnabled    = args.Position == HandPosition.Down;
 }
Exemplo n.º 10
0
 void OnRightHandUpDownChanged(object sender, HandPositionChangedArgs args)
 {
     RightUpButton.IsEnabled      = args.Position == HandPosition.Up;
     RightCenter1Button.IsEnabled = args.Position == HandPosition.Center;
     RightDownButton.IsEnabled    = args.Position == HandPosition.Down;
 }