这个包提供了一个 Dart 接口来控制 Ryze Tello 无人机。

入门

  • 请确保您的 Tello 具有足够的电量
  • 打开您的 Tello
  • 连接到您的 Tello 的 wifi
  • 运行示例脚本并观看您的 Tello 飞行!

用法

这里有一些示例代码,展示了如何让 Tello 起飞,
在空中悬停 5 秒钟,然后降落。

重要的是要注意,必须调用 tello.disconnect()
以正确释放连接到 tello 的套接字。

import 'package:ryze_tello/ryze_tello.dart';

void main() async {
  late final Tello tello;

  try {
    /* Initializing */
    tello = await Tello.tello();

    /* Flying Around */
    await tello.takeoff();

    await Future.delayed(const Duration(seconds: 5));

    await tello.land();
  } finally {
    /* Cleanup & Disconnection */
    tello
        .disconnect(); 
  }
}

附加信息

您可能会发现这些链接对理解作为此包基础的底层 SDK 有所帮助

GitHub

查看 Github