#drone #edu #tokio #controlling #asynchronous #wifi #tello

tello-edu

用于控制和与Tello EDU无人机交互的库

13个版本 (4个重大更新)

0.5.5 2023年4月23日
0.5.4 2023年4月23日
0.4.1 2023年4月22日
0.3.1 2023年4月16日
0.1.1 2023年4月15日

#1370 in 网络编程

Download history 2/week @ 2024-03-07 13/week @ 2024-03-14 16/week @ 2024-03-28 79/week @ 2024-04-04 10/week @ 2024-04-11

每月118次下载

LGPL-2.1-only

35KB
574

tello-edu

一个用于使用异步Rust和Tokio控制并与Tello EDU无人机交互的库。所有操作都实现为可await的futures,当无人机发送命令消息的确认时完成。

use tello_edu::{Tello, Result};

#[tokio::main]
async fn main() {
    fly().await.unwrap();
}

async fn fly() -> Result<()> {
    // create a new drone in the `NoWifi` state 
    let drone = Tello::new();

    // wait until the host computer joins the drone's Wifi network
    // (joining the network is not automatic - how it happens is up to you)
    let drone = drone.wait_for_wifi().await?;

    // establish connection and put the drone in "command" mode
    let drone = drone.connect().await?;

    // fly!
    drone.take_off().await?;
    drone.turn_clockwise(360).await?;
    drone.land().await?;

    Ok(())
}

(如果你更擅长Python,还有一个等效的异步Python包 - tello-asyncio。)

版本历史

0.1.0

基本无人机控制

  • 用于发送命令和接收响应的UDP连接(默认AP模式 - 您必须加入无人机的WiFi网络)
  • 起飞和降落
  • 顺时针和逆时针旋转
  • 向上、向下、向左、向右、向前和向后移动
  • 紧急停止

0.1.1

  • 在Linux以及macOS上等待WiFi,其他情况假设有WiFi

0.2.0

更多无人机控制

  • 设置和查询速度
  • 停止
  • 左转、右转、前翻和后翻

0.3.1

无人机状态

  • 无人机状态流(除任务板数据外)

0.4.0

视频

  • 开始/停止视频流
  • 接收h264编码帧
  • 解码并显示视频示例

0.5.0

远程控制

  • 实时控制
  • 使用游戏控制器飞行无人机的示例

依赖关系

~3–12MB
~119K SLoC