Esempio 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;
            }
        }
Esempio 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;
            }
        }
Esempio 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;
            }
        }
Esempio 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;
            }
        }
Esempio 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;
            }
        }
Esempio 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;
            }
        }
Esempio 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;
 }
Esempio 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;
 }
Esempio 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;
 }
Esempio 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;
 }