public static string GetCommand(int X) { string baseCmd = "speed"; TelloCommand.ValidateIntegerParameter(baseCmd, "X", X, 10, 100); return(String.Format("{0} {1}", baseCmd, X)); }
/// <summary> /// Set radio control via four channels /// </summary> /// <param name="A">left/right</param> /// <param name="B">forward/backward</param> /// <param name="C">up/down</param> /// <param name="D">yaw</param> public static string GetCommand(int A, int B, int C, int D) { string baseCmd = "rc"; TelloCommand.ValidateIntegerParameter(baseCmd, "A (left/right)", A, -100, 100); TelloCommand.ValidateIntegerParameter(baseCmd, "B (forward/backward)", B, -100, 100); TelloCommand.ValidateIntegerParameter(baseCmd, "C (up/down)", C, -100, 100); TelloCommand.ValidateIntegerParameter(baseCmd, "D (yaw)", D, -100, 100); return(String.Format("{0} {1} {2} {3} {4}", baseCmd, A, B, C, D)); }
public static string GetCommand(int X, int Y, int Z, int Speed) { string baseCmd = "go"; TelloCommand.ValidateIntegerParameter(baseCmd, "X", X, 20, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "Y", Y, 20, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "Z", Z, 20, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "Speed", Speed, 10, 100); return(String.Format("{0} {1} {2} {3} {4}", baseCmd, X, Y, Z, Speed)); }
/// <summary> /// Fly a curve defined by the current and two given coordinates with speed (cm/s) /// Arc radius must be within the range of 0.5-10 meters /// X/Y/Z can’t be between -20 – 20 at the same time /// </summary> /// <param name="X1"></param> /// <param name="Y1"></param> /// <param name="Z1"></param> /// <param name="X2"></param> /// <param name="Y2"></param> /// <param name="Z2"></param> /// <param name="Speed"></param> public static string GetCommand(int X1, int Y1, int Z1, int X2, int Y2, int Z2, int Speed) { string baseCmd = "curve"; TelloCommand.ValidateIntegerParameter(baseCmd, "X1", X1, 20, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "Y1", Y1, 20, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "Z1", Z1, 0, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "X2", X2, 20, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "Y2", Y2, 20, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "Z2", Z2, 0, 500); TelloCommand.ValidateIntegerParameter(baseCmd, "Speed", Speed, 10, 100); return(String.Format("{0} {1} {2} {3} {4} {5} {6} {7}", baseCmd, X1, Y1, Z1, X2, Y2, Z2, Speed)); }