Struct Drone

Source
pub struct Drone { /* private fields */ }

Implementations§

Source§

impl Drone

Source

pub fn new() -> Self

Instantiate a new Drone object

Source§

impl Drone

Source

pub fn get_pitch(&mut self) -> i32

Returns pitch in degree

Source

pub fn get_roll(&mut self) -> i32

Returns roll in degree

Source

pub fn get_yaw(&mut self) -> i32

Returns yaw in degree

Source

pub fn get_speed_x(&mut self) -> i32

X axis speed

Source

pub fn get_speed_y(&mut self) -> i32

Y axis speed

Source

pub fn get_speed_z(&mut self) -> i32

Z axis speed

Source

pub fn get_acceleration_x(&mut self) -> f64

X axis acceleration

Source

pub fn get_acceleration_y(&mut self) -> f64

Y axis acceleration

Source

pub fn get_acceleration_z(&mut self) -> f64

Z axis acceleration

Source

pub fn get_lowest_temperature(&mut self) -> i32

Get lowest temperature

Source

pub fn get_highest_temperature(&mut self) -> i32

Get highest temperature

Source

pub fn get_temperature(&mut self) -> i32

Get average temperature

Source

pub fn get_height(&mut self) -> i32

Get current height in cm

Source

pub fn get_distance_tof(&mut self) -> i32

Get current distance value from TOF in cm

Source

pub fn get_barometer(&mut self) -> f64

Get current barometer measurement in cm -> absolute height

Source

pub fn get_flight_time(&mut self) -> i32

Get the time the motors have been active in seconds

Source

pub fn get_battery(&mut self) -> i32

Source§

impl Drone

Source

pub fn connect(&mut self)

Source

pub fn send_keepalive(&mut self)

Source

pub fn turn_motor_on(&mut self)

Source

pub fn turn_motor_off(&mut self)

Source

pub fn initiate_throw_takeoff(&mut self)

Source

pub fn takeoff(&mut self)

Source

pub fn land(&mut self)

Source

pub fn streamon(&mut self)

Source

pub fn streamoff(&mut self)

Source

pub fn emergency(&mut self)

Source

pub fn move_any(&mut self, direction: &str, x: i32)

Move in any chosen direction\n direction: up, down, left, right, forward or back\n x: 20-500

Source

pub fn move_up(&mut self, x: i32)

Move up x: 20-500 in cm

Source

pub fn move_down(&mut self, x: i32)

Move down x: 20-500 in cm

Source

pub fn move_left(&mut self, x: i32)

Move left x: 20-500 in cm

Source

pub fn move_right(&mut self, x: i32)

Move right x: 20-500 in cm

Source

pub fn move_forward(&mut self, x: i32)

Move forward x: 20-500 in cm

Source

pub fn move_back(&mut self, x: i32)

Move back x: 20-500 in cm

Source

pub fn rotate_clockwise(&mut self, x: i32)

Rotate x degree clockwise

Source

pub fn rotate_counter_clockwise(&mut self, x: i32)

Rotate x degree counter-clockwise

Source

pub fn flip(&mut self, direction: &str)

Do a flip maneuver, helper for flip_x functions

Source

pub fn flip_left(&mut self)

Flip left

Source

pub fn flip_right(&mut self)

Flip right

Source

pub fn flip_forward(&mut self)

Flip forward

Source

pub fn flip_back(&mut self)

Flip backwards

Source

pub fn go_xyz_speed(&mut self, x: i32, y: i32, z: i32, speed: i32)

Fly to xyz relative to current position\n Speed in cm/s\n Argument ranges:\n x: -500 - 500\n y: -500 - 500\n z: -500 - 500\n speed 10 - 100

Source

pub fn curve_xyz_speed( &mut self, x1: i32, y1: i32, z1: i32, x2: i32, y2: i32, z2: i32, speed: i32, )

Fly to x2 y2 z2 in a curve via x1 y1 z1, speed is travelling speed in cm/s\n Both points relative to current position\n Argument value ranges:\n x1: -500 - 500\n y1: -500 - 500\n z1: -500 - 500\n x2: -500 - 500\n y2: -500 - 500\n z2: -500 - 500\n speed: 10 - 60

Source

pub fn set_speed(&mut self, speed: i32)

Set speed in cm/s

Source

pub fn send_rc_control( &mut self, left_right_velocity: i32, forward_backward_velocity: i32, up_down_velocity: i32, yaw_velocity: i32, )

Send RC control via four channels. Command is sent every self.TIME_BTW_RC_CONTROL_COMMANDS seconds. Argument parameters: left_right_velocity: -100~100 (left/right) forward_backward_velocity: -100~100 (forward/backward) up_down_velocity: -100~100 (up/down) yaw_velocity: -100~100 (yaw)

Source

pub fn set_wifi_credentials(&mut self, ssid: &str, password: &str)

Set the WiFi SSID and Password for the Tello, will cause a reboot

Source

pub fn connect_to_wifi(&mut self, ssid: &str, password: &str)

Only works on Tello-EDU Connects to a WiFi with the SSID and Password

Source

pub fn set_network_ports( &mut self, state_packet_port: i32, video_stream_port: i32, )

Can change the ports of the Tello drone’s state and video packets Not supported in this library

Source

pub fn reboot(&mut self)

Reboots the drone

Source

pub fn set_video_bitrate(&mut self, bitrate: i32)

Sets the bitrate of the video stream\n Only supports MBPS as i32 in the range of [0, 5] where 0 is auto

Source

pub fn set_video_resolution(&mut self, resolution: &str)

Sets the resolution of the video stream\n ‘low’ for 480P\n ‘high’ for 720P\n

Source

pub fn set_video_fps(&mut self, fps: &str)

Set the frames per second of the video stream\n ‘low’ for 5 fps\n ‘middle’ for 15 fps\n ‘high’ for 30 fps\n

Source

pub fn set_video_direction(&mut self, direction: i32)

Selects one of 2 cameras for streaming\n Forward camera is the regular 1080x720 colour camera\n Downward camera is a grey-only 320x240 IR-sensitive camera\n

Source§

impl Drone

Source

pub fn go_xyz_speed_mid(&mut self, x: i32, y: i32, z: i32, mid: i32)

Fly to xyz relative to mission pad with id: mid\n Speed in cm/s\n Argument value ranges:\n x: -500 - 500\n y: -500 - 500\n z: -500 - 500\n mid: 1 - 8

Source

pub fn curve_xyz_speed_mid( &mut self, x1: i32, y1: i32, z1: i32, x2: i32, y2: i32, z2: i32, speed: i32, mid: i32, )

Fly to x2 y2 z2 in a curve via x1 y1 z1, speed is travelling speed in cm/s\n Both points relative to mission pad with id: mid\n Argument value ranges:\n x1: -500 - 500\n y1: -500 - 500\n z1: -500 - 500\n x2: -500 - 500\n y2: -500 - 500\n z2: -500 - 500\n speed: 10 - 60

Source

pub fn enable_mission_pads(&mut self)

Source

pub fn disable_mission_pads(&mut self)

Source

pub fn set_mission_pad_detection_direction(&mut self, direction: i32)

Source§

impl Drone

Source

pub fn query_speed(&mut self) -> i32

Source

pub fn query_battery(&mut self) -> i32

Source

pub fn query_flight_time(&mut self) -> i32

Source

pub fn query_height(&mut self) -> i32

Source

pub fn query_temperature(&mut self) -> i32

Source

pub fn query_attitude(&mut self) -> HashMap<String, i32>

Query IMU attitude data\n Using get_pitch, get_roll and get_yaw is usually faster\n Returns Map with {‘pitch’: i32, ‘roll’: int, ‘yaw’: i32}

Source

pub fn query_barometer(&mut self) -> f64

Source

pub fn query_distance_tof(&mut self) -> f64

Source

pub fn query_wifi_signal_noise_ratio(&mut self) -> String

Source

pub fn query_sdk_version(&mut self) -> String

Source

pub fn query_serial_number(&mut self) -> String

Source

pub fn query_active(&mut self) -> String

Auto Trait Implementations§

§

impl Freeze for Drone

§

impl RefUnwindSafe for Drone

§

impl Send for Drone

§

impl Sync for Drone

§

impl Unpin for Drone

§

impl UnwindSafe for Drone

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.