[][src]Struct tello::Drone

pub struct Drone {
    pub rc_state: RCState,
    pub drone_meta: DroneMeta,
    // some fields omitted
}

Main connection and controller for the drone

Fields

rc_state: RCState

remote control values to control the drone

drone_meta: DroneMeta

current meta data from the drone

Methods

impl Drone[src]

pub fn new(ip: &str) -> Drone[src]

create a new drone and and listen to the Response port 8889 this struct implements a number of commands to control the drone

After connection to the drone it is very important to poll the drone at least with 20Hz. This will acknowledge some messages and parse the state of the drone.

Example

let mut drone = Drone::new("192.168.10.1:8889");
drone.connect(11111);
// wait for the connection
drone.take_off();

pub fn connect(&mut self, video_port: u16) -> usize[src]

Connect to the drone and inform the drone on with port you are ready to receive the video-stream

The Video stream do not start automatically. You have to start it with drone.start_video() and pool every key-frame with an additional drone.start_video() call.

pub fn send(&self, command: UdpCommand) -> Result<(), ()>[src]

pub fn poll(&mut self) -> Option<Message>[src]

impl Drone[src]

pub fn take_off(&self) -> Result<(), ()>[src]

pub fn throw_and_go(&self) -> Result<(), ()>[src]

pub fn land(&self) -> Result<(), ()>[src]

pub fn stop_land(&self) -> Result<(), ()>[src]

pub fn palm_land(&self) -> Result<(), ()>[src]

pub fn flip(&self, direction: Flip) -> Result<(), ()>[src]

pub fn bounce(&self) -> Result<(), ()>[src]

pub fn bounce_stop(&self) -> Result<(), ()>[src]

pub fn get_version(&self) -> Result<(), ()>[src]

pub fn get_alt_limit(&self) -> Result<(), ()>[src]

pub fn set_alt_limit(&self, limit: u8) -> Result<(), ()>[src]

pub fn get_att_angle(&self) -> Result<(), ()>[src]

pub fn set_att_angle(&self) -> Result<(), ()>[src]

pub fn get_battery_threshold(&self) -> Result<(), ()>[src]

pub fn set_battery_threshold(&self, threshold: u8) -> Result<(), ()>[src]

pub fn get_region(&self) -> Result<(), ()>[src]

pub fn send_stick(
    &self,
    pitch: f32,
    nick: f32,
    roll: f32,
    yaw: f32,
    fast: bool
) -> Result<(), ()>
[src]

pub fn send_date_time(&self) -> Result<(), ()>[src]

pub fn add_time(command: UdpCommand) -> UdpCommand[src]

pub fn add_date_time(command: UdpCommand) -> UdpCommand[src]

impl Drone[src]

pub fn start_video(&mut self) -> Result<(), ()>[src]

start_video starts the streaming and requests the info (SPS/PPS) for the video stream.

Video-metadata: e.g.: caps = video/x-h264, stream-format=(string)avc, width=(int)960, height=(int)720, framerate=(fraction)0/1, interlace-mode=(string)progressive, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, alignment=(string)au, profile=(string)main, level=(string)4, codec_data=(buffer)014d4028ffe10009674d402895a03c05b901000468ee3880

Examples

let mut drone = Drone::new("192.168.10.1:8889");
drone.connect(11111);
// ...
drone.start_video().unwrap();

pub fn poll_key_frame(&mut self) -> Result<(), ()>[src]

Same as start_video(), but a better name to poll the (SPS/PPS) for the video stream.

pub fn set_video_mode(&mut self, mode: VideoMode) -> Result<(), ()>[src]

Set the video mode to 960x720 4:3 video, or 1280x720 16:9 zoomed video. 4:3 has a wider field of view (both vertically and horizontally), 16:9 is crisper.

Examples

let mut drone = Drone::new("192.168.10.1:8889");
drone.connect(11111);
// ...
drone.set_video_mode(VideoMode::M960x720).unwrap();

pub fn set_exposure(&mut self, level: u8) -> Result<(), ()>[src]

Set the camera exposure level. param level: it can be 0, 1 or 2

Examples

let mut drone = Drone::new("192.168.10.1:8889");
drone.connect(11111);
// ...
drone.set_exposure(2).unwrap();

pub fn set_video_bitrate(&mut self, rate: u8) -> Result<(), ()>[src]

set the video encoder rate for the camera. param rate: TODO: unknown

Examples

let mut drone = Drone::new("192.168.10.1:8889");
drone.connect(11111);
// ...
drone.set_video_bitrate(3).unwrap();

pub fn take_picture(&self) -> Result<(), ()>[src]

take a single picture and provide it to download it.

Examples

let mut drone = Drone::new("192.168.10.1:8889");
drone.connect(11111);
// ...
drone.take_picture(3).unwrap();

@TODO: download image

Trait Implementations

impl Debug for Drone[src]

Auto Trait Implementations

impl RefUnwindSafe for Drone

impl Send for Drone

impl Sync for Drone

impl Unpin for Drone

impl UnwindSafe for Drone

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.