Exemplo n.º 1
0
 public static Task <bool> RC(this ITelloClient tello, int leftright, int forwardbackward, int updown, int yaw)
 {
     CommandConstraints.CheckRC(leftright);
     CommandConstraints.CheckRC(forwardbackward);
     CommandConstraints.CheckRC(updown);
     CommandConstraints.CheckRC(yaw);
     return(tello.SendAction($"rc {leftright} {forwardbackward} {updown} {yaw}"));
 }
Exemplo n.º 2
0
 // ToDo: FlyTo overload "mid"
 public static Task <bool> FlyTo(this ITelloClient tello, int x, int y, int z, int speed)
 {
     CommandConstraints.CheckDistance(x);
     CommandConstraints.CheckDistance(y);
     CommandConstraints.CheckDistance(z);
     CommandConstraints.CheckSpeed(speed);
     return(tello.SendAction($"go {x} {y} {z} {speed}"));
 }
Exemplo n.º 3
0
        // ToDo: Curve overload "mid"
        public static Task <bool> Curve(this ITelloClient tello, int x1, int y1, int z1, int x2, int y2, int z2, int speed)
        {
            CommandConstraints.CheckDistance(x1);
            CommandConstraints.CheckDistance(y1);
            CommandConstraints.CheckDistance(z1);
            CommandConstraints.CheckDistance(x2);
            CommandConstraints.CheckDistance(y2);
            CommandConstraints.CheckDistance(z2);
            CommandConstraints.CheckSpeed(speed);

            // ToDo: x/y/z can’t be between -20 20 at the same time.

            return(tello.SendAction($"curve {x1} {y1} {z1} {x2} {y2} {z2} {speed}"));
        }
Exemplo n.º 4
0
 public static Task <bool> Speed(this ITelloClient tello, int speed)
 {
     CommandConstraints.CheckSpeed(speed);
     return(tello.SendAction($"speed {speed}"));
 }
Exemplo n.º 5
0
 public static Task <bool> RotateDirection(this ITelloClient tello, bool clockwise, int degree)
 {
     CommandConstraints.CheckDegree(degree);
     return(tello.SendAction($"{(clockwise ? "cw" : "ccw")} {degree}"));
 }
Exemplo n.º 6
0
 public static Task <bool> FlyDirection(this ITelloClient tello, MoveDirection direction, int cm)
 {
     CommandConstraints.CheckDistance(cm);
     return(tello.SendAction($"{direction.ToString().ToLower()} {cm}"));
 }