tello_edu/lib.rs
1//! A library for controlling and interacting with the [Tello EDU](https://www.ryzerobotics.com/tello-edu)
2//! drone using [asynchronous Rust](https://rust-lang.github.io/async-book/) and [Tokio](https://tokio.rs).
3//!
4//! All operations are implemented as awaitable futures, completed when the
5//! drone sends acknowledgment of the command message.
6//!
7//! ```
8//! use tello_edu::{Tello, Result};
9//!
10//! #[tokio::main]
11//! async fn main() {
12//! fly().await.unwrap();
13//! }
14//!
15//! async fn fly() -> Result<()> {
16//! // create a new drone in the `NoWifi` state
17//! let drone = Tello::new();
18//!
19//! // wait until the host computer joins the drone's Wifi network
20//! // (joining the network is not automatic - how it happens is up to you)
21//! let drone = drone.wait_for_wifi().await?;
22//!
23//! // establish connection and put the drone in "command" mode
24//! let drone = drone.connect().await?;
25//!
26//! // fly!
27//! drone.take_off().await?;
28//! drone.turn_clockwise(360).await?;
29//! drone.land().await?;
30//!
31//! Ok(())
32//! }
33//! ```
34//!
35
36mod errors;
37mod wifi;
38mod tello;
39mod state;
40mod options;
41mod video;
42mod command;
43
44pub use errors::{TelloError, Result};
45pub use tello::Tello;
46pub use options::TelloOptions;
47pub use state::{TelloStateReceiver, TelloState};
48pub use video::{VIDEO_WIDTH, VIDEO_HEIGHT, TelloVideoReceiver};
49pub use command::{TelloCommandSender, TelloCommand};
50
51pub use tokio::time::Duration;