Struct TelloState

Source
pub struct TelloState {
    pub roll: i16,
    pub pitch: i16,
    pub yaw: i16,
    pub height: i16,
    pub barometer: f32,
    pub battery: u8,
    pub time_of_flight: u16,
    pub motor_time: u16,
    pub temperature_low: i16,
    pub temperature_high: i16,
    pub velocity: Vector3<i16>,
    pub acceleration: Vector3<f32>,
}
Expand description

The live state of the drone.

Fields§

§roll: i16

Roll angle in degrees.

§pitch: i16

Pitch angle in degrees.

§yaw: i16

Yaw angle in degrees.

§height: i16

Height above launch point in cm

§barometer: f32

Barometer measurement in cm (height?)

§battery: u8

Battery level as percentage.

§time_of_flight: u16

Not sure what this actually is - Tello docs says “time of flight distance in cm”

§motor_time: u16

The time the motors have been active for, in seconds.

§temperature_low: i16

Minimum temperature, Celsius.

§temperature_high: i16

Maximum temperature, Celsius.

§velocity: Vector3<i16>

Velocity, cm⁻¹

§acceleration: Vector3<f32>

Acceleration, cms⁻²

Implementations§

Source§

impl TelloState

Source

pub fn from_message(s: &str) -> Result<TelloState>

Parses a state string received from the drone.

Example message: “mid:-1;x:-100;y:-100;z:-100;mpry:-1,-1,-1;pitch:0;roll:0;yaw:-3;vgx:0;vgy:0;vgz:1;templ:58;temph:60;tof:71;h:50;bat:82;baro:-57.14;time:14;agx:17.00;agy:-4.00;agz:-956.00;”

Trait Implementations§

Source§

impl Debug for TelloState

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for TelloState

Source§

fn default() -> TelloState

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.