Tello SDK 3.0 User Guide en

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

ROBOMASTER TT

SDK 3.0 User Guide


V1.0 2021.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-source
TT 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 Responses


Tello IP: 192.168.10.1 UDP PORT: 8889 << - - >> PC / Mac / Mobile
Remark 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 Tello UDP port
8889 to launch Tello's SDK mode.

Receive Tello State


Tello IP: 192.168.10.1 - >> PC / Mac / Mobile UDP Server: 0.0.0.0 UDP PORT:8890
Remark 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 Streams


Tello IP: 192.168.10.1 - >> PC / Mac / Mobile UDP Server: 0.0.0.0 UDP PORT:11111
Remark 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 "streamon"
command to Tello UDP port 8889 to start receiving Tello video streams.

2  © 2021 Ryze Tech. All Rights Reserved.


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
land Auto landing
streamon Turn on the video stream. ok / error
streamoff Turn off the video stream.
emergency Stop the motor from running.
Fly upward by x cm.
up x
x = 20-500
Fly downward by x cm.
down x
x = 20-500
Fly leftward by x cm.
left x
x = 20-500
Fly rightward by x cm.
right x
x = 20-500
ok/error + error
ok/error + error status
status
Fly forward by x cm.
forward x
x = 20-500
Fly backward by x cm.
back x
x = 20-500
Rotate clockwise by x°.
cw x
x = 1-360
Rotate counterclockwise by x°.
ccw x
x = 1-360
motoron Enter Motor-On mode (*Note 1).
motoroff Exit Motor-On mode.
ok / error
Throw to launch. Throw the drone horizontally within
throwfly
5s of sending the command.

© 2021 Ryze Tech. All Rights Reserved.   3


Roll in the x direction.
l = (left)
flip x r =(right) ok / error
f = (forward)
b = (back)
Fly to the coordinates (x,y,z) at the set speed (cm/s).
x: -500 - 500
y: -500 - 500
ok/error + error
go x y z speed z: -500 - 500
status
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
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.
curve x1 y1 z1 x2 y2 x1, x2: -500 - 500
z2 speed 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
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
go x y z speed mid y: -500 - 500
z: 0 - 500
speed: 10-100 (cm/s) ok/error + error
x, y, and z cannot be between -20 and 20 at the same status
time
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.
curve x1 y1 z1 x2 y2
x1, x2: -500 - 500
z2 speed mid
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
Tello flies to the point (x,y,z) in the mid1 coordinate
jump x y z speed yaw system and hovers. Then, it identifies the mission pad
mid1 mid2 of mid2 and rotates to the position (0,0,z) in the mid2
coordinate system to set the yaw value (z>0).
No response
reboot Reboot the drone.
(success)/error

4  © 2021 Ryze Tech. All Rights Reserved.


Setting Commands

Command Description Possible Response


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

© 2021 Ryze Tech. All Rights Reserved.   5


Set the video stream bit rate. The bitrate parameter
specifies the bit rate, with a value range is 0 to 5,
setbitrate bitrate
indicating auto, 1Mbps, 2MBps, 3Mbps, 4Mbps, and
5Mbps, respectively.
ok / error
Set the video stream resolution. The resolution
setresolution parameter specifies the resolution, whose value
resolution can be "high" or "low", indicating 720P and 480P,
respectively.

Read Commands

Command Description Possible Response


x
speed? Get the current set speed (cm/s).
x = (10-100)
Get the percentage (%) indicating the current battery x
battery?
level. x = (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
Get whether TT is connected to an open-source
hardware? controller. If yes, it returns RMTT; if not, it returns TELLO/RMTT
TELLO.
Query the -WiFi version of the open-source controller.
wifiversion? wifivx.x.x.x
(Only applies to the open-source controller)
Name and
Get the name and password of the current router
password of
ap? to be connected. (Only applies to the open-source
the router to be
controller)
connected
In STA mode:
factory default SSID;
Get the current SSID of the drone. (Only applies to the
ssid? in AP mode: user-
open-source controller)
defined SSID and
password
Set the SSID and password of the open-source
multiwifi ssid pass controller. This feature supports connection to multiple ok / error
devices as a router.

Open-source Controller->Tello Commands


To 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"

6  © 2021 Ryze Tech. All Rights Reserved.


UDP->Open-source controller ESP32
*Only factory firmware is supported. To reset the factory firmware, see the User Manual.
Command Description Possible Response
Light up the top LED in the specified color. The r,
g, and b variables indicate the red, green, and blue
channels, respectively.
EXT led r g b
r: 0-255
g: 0-255
b: 0-255
led ok/error
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
EXT led br t r g b
is counted as one pulse.
r, g, b: 0~255
t: 0.1-2.5Hz
The top LED flashes alternately between color 1 (r1,
g1, b1) and color (r2, g2, b2) according to the flash
EXT led bl t a1 b1 c1
frequency t.
a2 b2 c2
a1 b1 c1 a2 b2 c2: 0~255
t: 0.1-10Hz
Light up the dot-matrix display with the specified
EXT mled g xxxxx pattern.
xxxx: (*Note 3)
The dot-matrix display indicates the direction of
movement as a string.
l/r/u/d indicates left/right/up/down movement.
EXT mled l/r/u/d r/b/ p
r/b/p indicates the display color the string.
t xxxx
t: 0.1-2.5Hz, indicating the frame rate of the image.
xxxx indicates the string to be displayed, which
cannot exceed 70 characters.
mled ok/error
The dot-matrix display indicates the direction of
movement as an image.
EXT mled l/r/u/d g t l/r/u/d indicates left/right/up/down movement.
xxxx r/b/p indicates the display color the string.
t: 0.1-2.5Hz, indicating the frame rate of the image.
xxxx: (*Note 3)
Display static ASCII character or preset pattern.
EXT mled s r/b/p xxxx r/b/p indicates the display color of the string.
xxxxx can only be "heart" or an ASCII character.
Set the dot-matrix display boot animation. The pattern
EXT mled sg xxxx set will be displayed after every boot.
xxxx: (*Note 3)
EXT mled sc Clear the set boot animation.
Set the dot-matrix display brightness.
EXT mled sl n
n: 0~255

© 2021 Ryze Tech. All Rights Reserved.   7


tof xxxx
The unit of xxx is
EXT tof? Read the tof value. mm. It returns 8192
if the detection
range is exceeded.
Read the firmware version of the open-source
EXT version? esp32vx.x.x.x
controller ESP32.

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 algorithm
m-2: the mission pad nearest to Tello

Note 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: String
Example“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 centimeters
If 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 centimeters
If 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.

8  © 2021 Ryze Tech. All Rights Reserved.


z: the z-axis coordinate of the drone relative to the detected mission pad, in centimeters
If 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 moff
mdirection x
go x y z speed mid
curve x1 y1 z1 x2 y2 z2 speed mid
jump x y z speed yaw mid1 mid2

Mission pad instructions for use can be downloaded from the official website.

© 2021 Ryze Tech. All Rights Reserved.   9


This content is subject to change.

Download the latest version from


www.dji.com/robomaster-tt/downloads

Copyright © 2021 Ryze Tech. All Rights Reserved.

You might also like