Tello SDK
1.3.0.0
日本語(Japanese)
Lina Katayose
日本語翻訳
15 Aug 2020
※注意:本家の英語版を勝手に翻訳したものです。今後のSDK利用のためにわかりやすく日本語に変 換したものです。一部加筆等行っておりますが、急いで作ったのでおかしな日本語があります。 すべての動作確認は行っていませんので、各自自己責任で動作確認の上ご利用ください。1. 概要(OVERVIEW)
Tello SDKは、WiFIのUDPポートを介して機体に接続し、ユーザーがPythonコマンドでド
ローンをコントロールするものです。ここをクリックすると、本家の
Tello.py
がダウン
ロードできます。
(リンク先) https://terra-1-g.djicdn.com/2d4dce68897a46b19fc717f3576b7c6a/Tello .程相./Both/Tello3(1).py The Tello SDK connects to the aircraft through a Wi-Fi UDP port, allowing users to control the drone with text commands. Click here to download the Tello3.py file.
※UDP:User Datagram Protocolの略。 PC⇔Tello内のネットワークにおいて、最小限の仕組みでデータ を送受信できるように考案されたシンプルなプロトコル。
2. 構成(ARCHITECTURE)
WiFiを使い、PC(Windows、Mac、Linux)またはスマートフォンに接続します。
Use Wi-Fi to establish communication between Tello and PC, Mac or Mobile deviceコマンドを送る
&
レスポンスを受け取る
Send Command & Receive Response
Tello IP: 192.168.10.1 UDP PORT:8889 <<- ->> PC/Mac/Mobile
備考1: PCまたはスマートフォンでUDPクライアントをセットアップして、同じポー
トを介してTelloとメッセージを送受信します。
Set up a UDP client on PC, Mac or Mobile device to send and receive message from Tello via the same port.
備考2:
UDPコマンド8889を介してTelloに「コマンド」コマンドを送信し、TelloのSDKを開
始する
モード、他のすべてのコマンドを送信する前。
Send “command” command to Tello via UDP PORT 8889 to initiate Tello’s SDK mode, before sending all other commands.
Telloの状態を受信する(Receive Tello State)
Tello IP: 192.168.10.1 ->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT:8890
備考3:
PC、Mac、またはモバイルデバイスにUDPサーバーをセットアップし、メッセージを
読みます
UDP PORT 8890を介したIP 0.0.0.0。受信していない場合は、Remark2を実
⾏して状態デー
タの受信を開始します。
Set up a UDP server on PC, Mac or Mobile device and listen the message from IP 0.0.0.0 via UDP PORT 8890. Do Remark2 to start receiving state data if you haven’t.
Telloビデオストリームを受信する(
Receive Tello Video Stream)
Tello IP: 192.168.10.1 ->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT:11111
備考4:
PC、Mac、またはモバイルデバイスにUDPサーバーを設定し、メッセージを聞く
UDP PORT 11111経由のIP 0.0.0.0。
Set up a UDP server on PC, Mac or Mobile device and listen the message from IP 0.0.0.0 via UDP PORT 11111.
備考5:
まだ
⾏っていない場合はRemark2を実⾏します。次に、「streamon」コマンドをUDP
経由でTelloに送信します
ストリーミングを開始するには、ポート8889。
Do Remark2 if you haven’t. Then send “streamon” command to Tello via UDP PORT 8889 to start the streaming.
3.
Telloコマンドのタイプと結果(
Tello COMMAND TYPES AND RESULTS)
このSDKには、3つの基本的なコマンドタイプが含まれています。
This SDK includes three basic command types.
•
制御コマンド(xxx)
Control Commands (xxx)
コマンドが正常に実⾏された場合、「ok」を返しますreturns “ok” if the command is executed successfully
失敗した場合は「エラー」または有益な結果コードを返しますreturns “error” or an informative result code if unsuccessful •
読み取りコマンド(xxx︖)
Read Commands (xxx?)
サブパラメーターの現在の値を返します。returns the current value of the sub-parameter(s).
• Setコマンド(xxx a)は、新しいサブパラメーター値を設定しようと試みます Set Command (xxx a) will attempt to set a new sub-parameter value(s)
コマンドが正常に実
⾏された場合、「ok」を返します
returns “ok” if the command is executed successfully
失敗した場合は「エラー」または有益な結果コードを返します
4. Tello コマンドTello COMMANDS
以下のコマンドで制御します。
Command コマンド後の状況 Possible Response
command SDKモードに入ります
entry SDK mode
ok error
Command Description Possible Response
takeoff Telloの自動離陸
Tello auto takeoff
Ok error
Command Description Possible Response
land Telloの自動着陸
Tello auto land
Ok error
Command Description Possible Response
streamon ビデオストリームをオン
(開始) Set video stream on
Ok error
Command Description Possible Response streamoff ビデオストリームをオフ
(停止)
Set video stream off
Ok error
Command Description Possible Response emergency すべてのモーターを停止しま
す Stop all motors
immediately
Ok error
Command Description Possible Response up x Telloがx(cm)上昇します
Tello fly up with
distance x cm x: 20-500
Ok error
Command Description Possible Response down x Telloがx(cm)降下します
Tello fly down with distance x cm x: 20-500
Ok error
Command Description Possible Response left x Telloが左にx(cm)移動しま
す
Tello fly left with distance x cm x: 20-500
Ok error
Command Description Possible Response right x Telloが右にx(cm)移動しま
す
Tello fly right with distance x cm x: 20-500
Ok error
Command Description Possible Response forward x Telloが前にx(cm)移動しま
す
Tello fly forward with distance x cm
x: 20-500
Ok error
Command Description Possible Response back x Telloが後ろにx(cm)移動し
ます Tello fly back with
distance x cm x: 20-500
Ok error
Command Description Possible Response cw x Telloが時計回りにx(度)回
転します
Tello rotate x degree clockwise x: 1-3600
Ok error
Command Description Possible Response ccw x Telloが反時計回りにx(度)
回転します Tello rotate x degree
counter- clockwise x: 1-3600
Ok error
Command Description Possible Response flip x Telloがxの方向にフリップ (宙返り)します Tello fly flip x l (left) r (right) f (forward) b (back) Ok error
Command Description Possible Response go x y z speed Telloがx,y,z方向に速度 (cm/s)で移動します Tello fly to x y z in speed (cm/s) x: 20-500 y: 20-500 z: 20-500 speed: 10-100 Ok error
Command Description Possible Response curve x1 y1 z1 x2 y2 z1 z2 speed Telloが現在の速度と指定され た2つの座標によって定義され た曲線を速度(cm / s)で飛び ます (弧の半径が0.5〜10メートル の範囲内にない場合) Tello fly a curve defined by
the current and two given coordinates with speed
(cm/s)
If the arc radius is
not within the range of
0.5-10 meters, it
responses false
x1, x2: 20-500 y1, y2: 20-500 z1, z2: 20-500 speed: 10-60x/y/z can’t be between -20 – 20 at the same time .
Ok error
設定コマンド (Set Commands)
Command Description Possible Response rc a b c d 4つのチャンネルを介してRCコ
ントロールします Send RC control via four
channels. a: 左/右 (-100~100) b: 前/後ろ (-100~100) c: 上昇/下降 (-100~100) d: ヨー(機体の回転) (-100~100) Ok error 機体の状況を読み取るコマンド(Read Commands)
Command Description Possible
Response speed? 現在の速度(cm/s)を取得しま
す
get current speed (cm/s)
x: 1-100
Command Description Possible
Response battery? 現在のバッテリー%を取得し
ます
get current battery percentage
x: 0-100
Command Description Possible
Response
time? 現在までの飛行時間(秒)を取
得します
get current fly time (s)
time
Command Description Possible Response speed x 速度をx(cm/s)に設定します
set speed to x cm/s x: 10-100
Ok error
Command Description Possible Response wifi ssid pass SSIDパスワードでWiFiをセッ
トします Set Wi-Fi with SSID
password
Ok error
Command Description Possible Response
height? 高さ(cm)を取得します
get height (cm)
x: 0-3000
Command Description Possible
Response
temp? 機体の温度(℃)を取得します
get temperature (℃)
x: 0-90
Command Description Possible Response attitude? IMU姿勢データを取得しま
す
get IMU attitude data
pitch roll yaw
※IMU:Inertial Measurement Unitの略で慣性計測装置です ※TOF:Time of Flightの略で飛行時間です。
Command Description Possible
Response
baro? バロメータ(値)を取得します
get barometer value (m)
x
Command Description Possible
Response acceleration? IMU角加速度データを取得しま
す
get IMU angular acceleration data
(0.001g)
x y z
Command Description Possible
Response tof? TOFから距離値(cm)を取得し
ます
get distance value from TOF
(cm)
x: 30-1000
Command Description Possible
Response wifi? WiFi SNRを取得します
get Wi-Fi SNR
5. Telloの状態(Tello STATE)
データタイプ(Data type): String
例:
“pitch:%d;roll:%d;yaw:%d;vgx:%d;vgy%d;vgz:%d;templ:%d;temph:%d;tof:%d;h:%d;bat:%d;b
aro:
%.2f; time:%d;agx:%.2f;agy:%.2f;agz:%.2f;\r\n”
Explanation:
o
pitch: Attitude pitch, degree
o
roll: Attitude roll, degree
o
yaw: Attitude yaw, degree
o
vgx: Speed x,
o
vgy: Speed y,
o
vgz: Speed z,
o
templ: Lowest temperature, celcius degree
o
temph: Highest temperature, celcius degree
o
tof: TOF distance, cm
o
h: Height, cm
o
bat: Current battery percentage, %
o
baro: Barometer measurement, cm
o
time: Motors on time,
o
agx: Acceleration x,
o
agy: Acceleration y,
o
agz: Acceleration z,
6. 安全機能(SAFETY FEATURE)
Telloが15秒間コマンドを受信しなかった場合は、自動的に着陸します。
If Tello does not receive any command input for 15 seconds, it will land automatically.7.Tello WiFiをリセットする(Reset Tello Wi-Fi)
TelloがオンになっているときにTelloを5秒間
⻑押しすると、インジケーターライトが
オフになり、
⻩⾊に点滅します。インジケーターライトが点滅する⻩⾊のライトを⽰す場合、Wi-Fi
SSIDとパスワードが
⼯場出荷時の設定にリセットされます。
デフォルトではパスワードはありません。
Long press Tello for 5 seconds while Tello is on, and the indicator light will turn off and then flash yellow. When the indicator light shows a flashing yellow light, the Wi-Fi SSID and password will be reset to the factory settings, and there is no password by default.