Struct tello_edu::Tello

source ·
pub struct Tello<S = NoWifi> { /* private fields */ }
Expand description

For interacting with the Tello EDU drone using the simple text-based UDP protocol.

The basic flow from the user’s point of view is

SEND command → drone does something → RECEIVE response when it’s finished

Messages are plain ASCII text, eg command forward 10 → response ok

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(())
}

Implementations§

source§

impl Tello<NoWifi>

source

pub fn new() -> Self

Create a new drone in a completely unconnected state.

Examples found in repository?
examples/take_off_and_land.rs (line 11)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.land().await?;

    Ok(())
}
More examples
Hide additional examples
examples/clockwise_360.rs (line 11)
10
11
12
13
14
15
16
17
18
19
20
21
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.turn_clockwise(360).await?;
    drone.land().await?;

    Ok(())
}
examples/emergency_stop.rs (line 11)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.emergency_stop().await?; // warning! this will make the drone drop like a brick

    Ok(())
}
examples/flip.rs (line 11)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}
examples/move.rs (line 11)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
examples/wifi_wait_for_connection.rs (line 11)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
async fn wifi_wait_for_connection() -> Result<()>{
    let drone = Tello::new();
    println!("Created drone: {drone:?}");

    let drone = drone.wait_for_wifi().await?;
    println!("WiFi available, drone is now: {drone:?}");

    let drone = drone.connect().await?;
    println!("connected, drone is now: {drone:?}");

    let drone = drone.disconnect();
    println!("disconnected, drone is now: {drone:?}");

    Ok(())
}
source

pub async fn wait_for_wifi(&self) -> Result<Tello<Disconnected>>

Wait until the host joins the drone’s WiFi network

nb exactly how the the network is joined is up to you

Examples found in repository?
examples/take_off_and_land.rs (line 12)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.land().await?;

    Ok(())
}
More examples
Hide additional examples
examples/clockwise_360.rs (line 12)
10
11
12
13
14
15
16
17
18
19
20
21
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.turn_clockwise(360).await?;
    drone.land().await?;

    Ok(())
}
examples/emergency_stop.rs (line 12)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.emergency_stop().await?; // warning! this will make the drone drop like a brick

    Ok(())
}
examples/flip.rs (line 12)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}
examples/move.rs (line 12)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
examples/wifi_wait_for_connection.rs (line 14)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
async fn wifi_wait_for_connection() -> Result<()>{
    let drone = Tello::new();
    println!("Created drone: {drone:?}");

    let drone = drone.wait_for_wifi().await?;
    println!("WiFi available, drone is now: {drone:?}");

    let drone = drone.connect().await?;
    println!("connected, drone is now: {drone:?}");

    let drone = drone.disconnect();
    println!("disconnected, drone is now: {drone:?}");

    Ok(())
}
source

pub async fn assume_wifi(&self) -> Result<Tello<Disconnected>>

Use this if you are already in the appropriate WiFi network.

source§

impl Tello<Disconnected>

source

pub async fn connect(&self) -> Result<Tello<Connected>>

Examples found in repository?
examples/take_off_and_land.rs (line 14)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.land().await?;

    Ok(())
}
More examples
Hide additional examples
examples/clockwise_360.rs (line 14)
10
11
12
13
14
15
16
17
18
19
20
21
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.turn_clockwise(360).await?;
    drone.land().await?;

    Ok(())
}
examples/emergency_stop.rs (line 14)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.emergency_stop().await?; // warning! this will make the drone drop like a brick

    Ok(())
}
examples/flip.rs (line 14)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}
examples/move.rs (line 14)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
examples/wifi_wait_for_connection.rs (line 17)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
async fn wifi_wait_for_connection() -> Result<()>{
    let drone = Tello::new();
    println!("Created drone: {drone:?}");

    let drone = drone.wait_for_wifi().await?;
    println!("WiFi available, drone is now: {drone:?}");

    let drone = drone.connect().await?;
    println!("connected, drone is now: {drone:?}");

    let drone = drone.disconnect();
    println!("disconnected, drone is now: {drone:?}");

    Ok(())
}
source§

impl Tello<Connected>

source

pub fn disconnect(&self) -> Tello<Disconnected>

Disconnect from the drone.

Examples found in repository?
examples/wifi_wait_for_connection.rs (line 20)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
async fn wifi_wait_for_connection() -> Result<()>{
    let drone = Tello::new();
    println!("Created drone: {drone:?}");

    let drone = drone.wait_for_wifi().await?;
    println!("WiFi available, drone is now: {drone:?}");

    let drone = drone.connect().await?;
    println!("connected, drone is now: {drone:?}");

    let drone = drone.disconnect();
    println!("disconnected, drone is now: {drone:?}");

    Ok(())
}
source

pub async fn send(&self, command: &str) -> Result<String>

Sends a command to the drone using the simple Tello UDP protocol, returning the reponse.

The basic flow from the user’s point of view is

SEND command → drone does something → RECEIVE response when it’s finished

Messages are plain ASCII text, eg command forward 10 → response ok

  • command the command to send, must be a valid Tello SDK command string
source

pub async fn send_expect_ok(&self, command: &str) -> Result<()>

Sends a command, resolving to an error if the response is not “ok”

  • command the command to send, must be a valid Tello SDK command string
source

pub async fn send_value_expect_ok<T: Display>( &self, command: &str, value: T ) -> Result<()>

Sends a command with a single value, resolving to an error if the response is not “ok”

  • command the command to send, must be a valid Tello SDK command string
  • value the value to append to the command
source

pub async fn send_expect_nothing(&self, command: &str) -> Result<()>

Sends a command, expecting no response at all from the drone.

  • command the command to send, must be a valid Tello SDK command string
source

pub async fn send_expect<T: FromStr>(&self, command: &str) -> Result<T>

Sends a command, expecting a response that can be parsed as type T from the drone.

  • command the command to send, must be a valid Tello SDK command string
source

pub async fn serial_number(&self) -> Result<String>

The unique drone serial number.

source

pub async fn sdk_version(&self) -> Result<String>

The Tello SDK version.

source

pub async fn battery(&self) -> Result<u8>

The drone battery level as a percentage.

source

pub async fn wifi_signal_to_noise_ratio(&self) -> Result<u8>

The WiFi signal to noise ratio as a percentage.

source

pub async fn flight_time(&self) -> Result<u16>

The flight time in seconds, requested directly from the drone.

source

pub async fn emergency_stop(&self) -> Result<()>

Immediately stop all motors.

warning! this will make the drone drop like a brick!

Examples found in repository?
examples/emergency_stop.rs (line 17)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.emergency_stop().await?; // warning! this will make the drone drop like a brick

    Ok(())
}
source

pub async fn take_off(&self) -> Result<()>

Take off and hover.

Examples found in repository?
examples/take_off_and_land.rs (line 16)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.land().await?;

    Ok(())
}
More examples
Hide additional examples
examples/clockwise_360.rs (line 16)
10
11
12
13
14
15
16
17
18
19
20
21
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.turn_clockwise(360).await?;
    drone.land().await?;

    Ok(())
}
examples/emergency_stop.rs (line 16)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.emergency_stop().await?; // warning! this will make the drone drop like a brick

    Ok(())
}
examples/flip.rs (line 16)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}
examples/move.rs (line 16)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
examples/speed.rs (line 16)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    // go away slowly
    drone.set_speed(25).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    // come back fast
    drone.set_speed(100).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    drone.land().await?;

    Ok(())
}
source

pub async fn land(&self) -> Result<()>

Land and stop motors.

Examples found in repository?
examples/take_off_and_land.rs (line 17)
10
11
12
13
14
15
16
17
18
19
20
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.land().await?;

    Ok(())
}
More examples
Hide additional examples
examples/clockwise_360.rs (line 18)
10
11
12
13
14
15
16
17
18
19
20
21
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.turn_clockwise(360).await?;
    drone.land().await?;

    Ok(())
}
examples/flip.rs (line 24)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}
examples/move.rs (line 23)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
examples/speed.rs (line 30)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    // go away slowly
    drone.set_speed(25).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    // come back fast
    drone.set_speed(100).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    drone.land().await?;

    Ok(())
}
source

pub async fn speed(&self) -> Result<f32>

The drone speed in cm/s, requested directly from the drone.

source

pub async fn set_speed(&self, speed: u8) -> Result<()>

Set the forward speed.

  • speed Desired speed, 10-100 cm/s
Examples found in repository?
examples/speed.rs (line 19)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    // go away slowly
    drone.set_speed(25).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    // come back fast
    drone.set_speed(100).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    drone.land().await?;

    Ok(())
}
source

pub async fn wait(&self, duration: Duration) -> Result<()>

Wait for the given length of time.

  • duration The time to wait
source

pub async fn stop(&self) -> Result<()>

Stop and hover in place.

source

pub async fn turn_clockwise(&self, degrees: u16) -> Result<()>

Turn clockwise.

  • degrees Angle in degrees 1-360°
Examples found in repository?
examples/clockwise_360.rs (line 17)
10
11
12
13
14
15
16
17
18
19
20
21
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.turn_clockwise(360).await?;
    drone.land().await?;

    Ok(())
}
More examples
Hide additional examples
examples/speed.rs (line 22)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    // go away slowly
    drone.set_speed(25).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    // come back fast
    drone.set_speed(100).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    drone.land().await?;

    Ok(())
}
source

pub async fn turn_counterclockwise(&self, degrees: u16) -> Result<()>

Turn counter-clockwise.

  • degrees Angle in degrees 1-360°
source

pub async fn move_up(&self, distance: u16) -> Result<()>

Move straight up.

  • distance Distance to travel, 20-500 cm
Examples found in repository?
examples/move.rs (line 17)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
source

pub async fn move_down(&self, distance: u16) -> Result<()>

Move straight down.

  • distance Distance to travel, 20-500 cm
Examples found in repository?
examples/move.rs (line 18)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
source

pub async fn move_left(&self, distance: u16) -> Result<()>

Move straight left.

  • distance Distance to travel, 20-500 cm
Examples found in repository?
examples/move.rs (line 19)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
source

pub async fn move_right(&self, distance: u16) -> Result<()>

Move straight right.

  • distance Distance to travel, 20-500 cm
Examples found in repository?
examples/move.rs (line 20)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
source

pub async fn move_forward(&self, distance: u16) -> Result<()>

Move straight forwards.

  • distance Distance to travel, 20-500 cm
Examples found in repository?
examples/move.rs (line 21)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
More examples
Hide additional examples
examples/speed.rs (line 20)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    // go away slowly
    drone.set_speed(25).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    // come back fast
    drone.set_speed(100).await?;
    drone.move_forward(300).await?;

    drone.turn_clockwise(180).await?;

    drone.land().await?;

    Ok(())
}
source

pub async fn move_back(&self, distance: u16) -> Result<()>

Move straight backwards.

  • distance Distance to travel, 20-500 cm
Examples found in repository?
examples/move.rs (line 22)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;
    drone.move_up(50).await?;
    drone.move_down(50).await?;
    drone.move_left(50).await?;
    drone.move_right(50).await?;
    drone.move_forward(50).await?;
    drone.move_back(50).await?;
    drone.land().await?;

    Ok(())
}
source

pub async fn flip_left(&self) -> Result<()>

Flip left. nb fails if battery is low

Examples found in repository?
examples/flip.rs (line 18)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}
source

pub async fn flip_right(&self) -> Result<()>

Flip right. nb fails if battery is low

Examples found in repository?
examples/flip.rs (line 19)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}
source

pub async fn flip_forward(&self) -> Result<()>

Flip forward. nb fails if battery is low

Examples found in repository?
examples/flip.rs (line 21)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}
source

pub async fn flip_back(&self) -> Result<()>

Flip back. nb fails if battery is low

Examples found in repository?
examples/flip.rs (line 22)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async fn fly() -> Result<()> {
    let drone = Tello::new()
        .wait_for_wifi().await?;

    let drone = drone.connect().await?;

    drone.take_off().await?;

    drone.flip_left().await?;
    drone.flip_right().await?;

    drone.flip_forward().await?;
    drone.flip_back().await?;
    
    drone.land().await?;

    Ok(())
}

Trait Implementations§

source§

impl<S: Debug> Debug for Tello<S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for Tello<S>where S: RefUnwindSafe,

§

impl<S> Send for Tello<S>where S: Send,

§

impl<S> Sync for Tello<S>where S: Sync,

§

impl<S> Unpin for Tello<S>where S: Unpin,

§

impl<S> UnwindSafe for Tello<S>where S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.