dji ROBOMASTER TT SDK 3.0 User Guide

ROBOMASTER TTSDK 3.0 User GuideV1.02021.04

Overview

The TT SDK connects to drones via Wi-Fi UDP protocol, allowing users to control drones through text commands.After installing the RoboMaster SDK, users can control the TT product, including the open-sourceTT controller and the drone itself. For specific instructions, visit the following website:https://robomaster-dev.readthedocs.io/latest/

Safety Function

After Tello executes the current command, if no command input is received (other than the [TELLO] battery?” command sent by the open-source controller for the battery status) within 15s, it will automatically land.

Resetting Wi-Fi

In the power-on state, long-press the power button for 5s, during which, the drone will reboot after the status indicator goes out. When the status indicator quickly flashes yellow, the SSID and password of the Wi-Fi network will be reset to their factory default settings, with no password required by default.

Architecture

Users can use a Wi-Fi network to connect the Tello drone to a PC, Mac, or mobile device.Sending Commands and Receiving ResponsesTello IP: 192.168.10.1 UDP PORT: 8889 << – – >> PC / Mac / MobileRemark 1: Set up a UDP client on a PC, Mac, or mobile device to send commands to Tello UDP port 8889 and receive responses.Remark 2: Before sending any other commands, send the “command” command to the Tello UDP port 8889 to launch Tello’s SDK mode.Receive Tello StateTello IP: 192.168.10.1 – >> PC / Mac / Mobile UDP Server: 0.0.0.0 UDP PORT:8890Remark 3: Complete the operations in Remark 1 and Remark 2 before proceeding. Set up a UDP server on the PC, Mac, or mobile device to receive messages from IP 0.0.0.0 via UDP port 8890.* For the detailed status information, see 5. Tello Status.Receiving Tello Video StreamsTello IP: 192.168.10.1 – >> PC / Mac / Mobile UDP Server: 0.0.0.0 UDP PORT:11111Remark 4: Set up a UDP server on the PC, Mac, or mobile device to receive messages from IP 0.0.0.0 via UDP port 11111.Remark 5: After performing the operations in Remark 1 and Remark 2, send the “stream” command to Tello UDP port 8889 to start receiving Tello video streams.

Tello Command Types and Results

The SDK commands received by Tello can be grouped into three basic types.Control command (xxx)

  • Tello returns “ok” if the command was executed successfully.
  • Tello returns “error” or a result code if the command failed.

Setting command (xx a)

  • Setting command (xx a) will attempt to set a new sub-parameter value (a).
  • Tello returns “ok” if the command was executed successfully.
  • Tello returns “error” or a result code if the command failed.

Read command (xx?)

  • Read the real-time sub-parameter value.

UDP->Tello Commands

Control Commands

Command Description

Possible Response

command Enter SDK command mode. ok / error / unactive
takeoff Auto take-off ok / error
land Auto landing
stream on Turn on the video stream.
stream off Turn off the video stream.
emergency Stop the motor from running.
up x Fly upward by x cm.x = 20-500 ok/error + error status

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

down x Fly downward by x cm.x = 20-500
left x Fly leftward by x cm. |x = 20-500
right x Fly rightward by x cm.x = 20-500
ok/error + error status
forward x Fly forward by x cm.x = 20-500
back x Fly backward by x cm.x = 20-500
cw x Rotate clockwise by x°.x = 1-360
ccw x Rotate counterclockwise by x°.x = 1-360
motoron Enter Motor-On mode (*Note 1). ok / error
motoroff Exit Motor-On mode.
throwfly Throw to launch. Throw the drone horizontally within 5s of sending the command.
flip x Roll in the x-direction. ok / error
I = (left)
r =(right)
f = (forward)
b = (back)
go x y z speed Fly to the coordinates (x,y,z) at the set speed (cm/s). ok/error + error status

 

 

 

 

x: -500 – 500
y: -500 – 500
z: -500 – 500 speed: 10-100 (cm/s)
x, y, and z cannot be between -20 and 20 at the same time
stop Stop moving and hover immediately. ok / error
curve xl yl zl x2 y2

z2 speed

 

 

 

 

 

 

 

 

Fly in a curve from (x1,y1,z1) to (x2,y2,z2) at the set speed (cm/s).If the radius of the curve is not within  0.5-10 meters, the corresponding reminder will be returned. ok/error + error status

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x1, x2: -500 – 500
y1, y2: -500 – 500
z1, z2: -500 – 500
speed: 10-60
x, y, and z cannot be between -20 and 20 at the same time
go x y z speed mid Fly to the coordinate point (x, y, z) in the coordinate system of the mission pad with the specified ID at the set speed (m/s)(*Note 2).
x:  -500 – 500
y:  -500 – 500
z:  0 – 500
speed: 10-100 (cm/s)
x, y, and z cannot be between -20 and 20 at the same time
curve xl yl zl x2 y2

z2 speed mid

 

 

 

 

 

 

 

 

 

Fly in a curve from point (x1,y1,z1) to point (x2,y2,z2) in the coordinate system of the mission pad with the set mid at the set speed (cm/s).If the radius of the curve is not within 0.5-10 meters, the corresponding reminder will be returned.
x1, x2:-500 – 500
y1, y2: -500 – 500
z1, z2: 0 – 500
speed: 10-60
x, y, and z cannot be between -20 and 20 at the same time
jump x y z speed yaw midi mid2

 

 

Tello flies to the point (x,y,z) in the midi coordinate system and hovers. Then, it identifies the mission pad of mid2 and rotates to the position (0,0,z) in the mid2 coordinate system to set the yaw value (z>0).
reboot Reboot the drone.No response No response (success)/error

Setting Commands

Command

Description

Possible Responst

speed x Set the current speed to x cm/s.x = 10-100 ok / error
rcabcd Set the lever force values for the four channels of theremote control.a: roll (-100 to 100)b: pitch (-100 to 100)c: throttle (-100 to 100)d: yaw (-100 to 100) No response
wifi ssid pass Change the Tello Wi-H password.ssid: The new Wi-Fi accountpass: The new Wi-Fi passwordIf an open-source controller is connected, ssid adds the RMTT- prefix by default. Otherwise, it adds theTELLO- prefix. OK, drone willreboot in 3s
mon Enables mission pad.By default, downward detection is enabled. ok / error
moff Disables mission pad detection.
mdirection x X=0/1/20: downward detection enabled.1: forward detection enabled.2: both forward and downward detection enabled.*Before use, you must use the mon command toenable the detection function. Downward detection isenabled by default.*When either forward-looking or downward-lookingdetection is enabled alone, the detection frequencyis 20Hz. If both enabled, detection will be performedalternatively, with a frequency of 10Hz in eachdirection
ap ssid pass Switch Tello to Station mode and connect to the AP.ssid: the Wi-Fi account to connect topass: the Wi-Fi password OK, the drone willreboot in 3s
wifisetchannel xxx Set the -WiFi channel of the open-source controller.xxx indicates the channel to be set. Note: To clearthe channel settings, you need to clear the Wi-Fiinformation. Then, set a channel that complies with local policies and regulations.(Only applies to the open-source controller) ok / error
port info vedio Set the ports for pushing status information and video streams. Here, info is the port for pushing status information, and video is the port for pushing video information. The range of ports is 1025 to 65535.
setfps fps Set the video stream frame rate. The fps parameterspecifies the frame rate, whose value can be “high”,*middle, or “low”, indicating 30fps, 15fps, and 5fps,respectively.

Read Commands

Command Description Possible Response
speed? Get the current set speed (cm/s). xx = (10-100)
battery? Get the percentage (%) indicating the current batterylevel. xx = (10-100)
time? Get the motor running time (s). x
wifi? Get the Wi-Fi SNR. SNR
sdk? Get the Tello SDK version number. xx(>=20)
sn? Get the Tello SN. Production SN
hardware? Get whether TT is connected to an open-source controller. If yes, it returns RMTT; if not, it returns TELLO. TELLO/RMTT
wifiversion? Query the -WiFi version of the open-source controller.(Only applies to the open-source controller) wifivx.x.x.x
ap? Get the name and password of the current routerto be connected. (Only applies to the open-sourcecontroller) Name and password of the router to beconnected
ssid? Get the current SSID of the drone. (Only applies to theopen-source controller) In STA mode:factory default SSID;in AP mode: user-defined SSID andpassword
multi wifi ssid pass Set the SSID and password of the open-source controller. This feature supports connection to multiple devices as a router. ok / error

Open-source Controller->Tello CommandsTo program the open-source controller ESP32, sending “[TELLO] (space)”+ UDP->Tello command through a serial port can achieve the same effect as UDP->Tello command description.Note that all commands that the open-source controller ESP32 receives from TELLO contain the “ETT (space)” prefix and “\r\n” (line break) suffix.For example: Instruct the drone to take off via open-source controller ESP32.ESP32->Tello: “[TELLO] takeoff” Tello->ESP32: “ETT ok\r\n”

UDP->Open-source controller ESP32*Only factory firmware is supported. To reset the factory firmware, see the User Manual.

Command

Description

Possible Response

EXT led r g b Light up the top LED in the specified color. The r, g, and b variables indicate the red, green, and blue channels, respectively.r: 0-255g: 0-255b: 0-255 led ok/error
EXT led br t r g b The top LED displays the pulse effect according to the max pulse brightness (r, g, b) and pulse frequency t.The cycle from dimmest to brightest to dimmest again is counted as one pulse.r, g, b: 0~255t: 0.1-2.5Hz
EXT led bl t a1 b1 c1

a2 b2 c2

The top LED flashes alternately between color 1 (r1, g1, b1) and color (r2, g2, b2) according to the flash frequency t.a1 b1 c1 a2 b2 c2: 0~255t: 0.1-10Hz mled ok/error
EXT mled g xxxxx Light up the dot-matrix display with the specified pattern.xxxx: (*Note 3)
EXT mled l/r/u/d r/b/ p

t xxxx

The dot-matrix display indicates the direction of movement as a string.l/r/u/d indicates left/right/up/down movement.r/b/p indicates the display color the string.t: 0.1-2.5Hz, indicating the frame rate of the image.xxxx indicates the string to be displayed, which cannot exceed 70 characters.
EXT mled l/r/u/d g t

xxxx

The dot-matrix display indicates the direction of movement as an image.l/r/u/d indicates left/right/up/down movement.r/b/p indicates the display color the string.t: 0.1-2.5Hz, indicating the frame rate of the image.xxxx: (*Note 3)
EXT mled s r/b/p xxxx Display static ASCII character or a preset pattern.r/b/p indicates the display color of the string. xxxxx can only be “heart” or an ASCII character.
EXT mled sg xxxx Set the dot-matrix display boot animation. The pattern set will be displayed after every boot.xxxx: (*Note 3)
EXT mled sc Clear the set boot animation.
EXT mled sl n Set the dot-matrix display brightness.n: 0~255
EXT tof? Read the tof value. tof xxxxThe unit of xxx is mm. It returns 8192 if the detection range is exceeded.
EXT version? Read the firmware version of the open-source controller ESP32. esp32vx.x.x.x

Note 1:The Motor-On mode is a new low-speed rotation state of TT propellers. Entering Motor-On mode indicates that the TT is ready for takeoff. At this time, the TT heat dissipation feature can be used to avoid shutdown caused by excessive temperatures. You can execute the “motoron” command to enable Motor-On mode only when the drone is in static standby status. After the drone takes off, it automatically exits Motor-On mode.Note 2:m1-m8: the mission pad ID on the corresponding mission pad.m-1: the first mission pad identified by Tello’s internal algorithmm-2: the mission pad nearest to TelloNote 3:xxxx indicates a string consisting only of ‘r’, ‘b’, ‘p’, and ‘0’. ‘r’, ‘b’, ‘p’, and ‘0’ indicate red, blue, purple, and off, respectively. The max string length is 64.For example: rrrbb0ppp indicates that lights 0 to 3 are red, lights 4 to 5 are blue, light 6 is off, and lights 7 to 9 are purple. If the length is less than 64, the unspecified LEDs will be off.

Tello State

Data type: StringExample“mid:%d;x:%d;y:%d;z:%d;mpry:%d,%d,%d;pitch:%d;roll:%d;yaw:%d;vgx:%d;vgy%d;v gz:% d;templ:%d;temph:%d;tof:%d;h:%d;bat:%d;baro:%f;\r\n”Description

  • mid: the detected mission pad ID.If the mission pad detection function is not enabled, -2 is returned.If the detection function is enabled but no mission pad is detected, -1 is returned.
  • x: the x-axis coordinate of the drone relative to the detected mission pad, in centimetersIf the mission pad detection function is not enabled, -200 is returned.If the detection function is enabled but no mission pad is detected, -100 is returned.
  • y: the y-axis coordinate of the drone relative to the detected mission pad, in centimetersIf the mission pad detection function is not enabled, -200 is returned.If the detection function is enabled but no mission pad is detected, -100 is returned.
  • z: the z-axis coordinate of the drone relative to the detected mission pad, in centimetersIf the mission pad detection function is not enabled, -200 is returned.If the detection function is enabled but no mission pad is detected, -100 is returned.
  • mpry: Pitch, yaw and roll angles (in degrees) of the drone in the mission pad. If no mission pad is detected, 0 is returned.
  • pitch: Pitch angle (in degrees)
  • roll: Roll angle (in degrees)
  • yaw: Yaw (in degrees)
  • vgx: X-axis speed (dm/s)
  • vgy: Y-axis speed (dm/s)
  • vgz: Z-axis speed (dm/s)
  • templ: The minimum temperature of the main board (°C)
  • temph: The maximum temperature of the main board (°C)
  • tof: ToF distance (cm)
  • h: Height relative to take-off point (cm)
  • bat: Percentage of current remaining battery capacity
  • baro: Height detected by barometer (m)
  • time: Motor running time (s)
  • agx: X-axis acceleration (cm/s2)
  • agy: Y-axis acceleration (cm/s2)
  • agz: X-axis acceleration (cm/s2)

Mid Command Restrictions Commands involving mid need to be used together with mission pads, and the go, curve, and jump commands can be used only when downward camera recognition is enabled. These commands include:mon moffmdirection xgo x y z speed midcurve x1 y1 z1 x2 y2 z2 speed midjump x y z speed yaw mid1 mid2Mission pad instructions for use can be downloaded from the official website.

This content is subject to change.Download the latest version fromwww.dji.com/robomaster-tt/downloadsCopyright © 2021 Ryze Tech. All Rights Reserved.

References

[xyz-ips snippet=”download-snippet”]


Posted

in

by