Struct crazyflie_lib::Crazyflie[][src]

pub struct Crazyflie {
    pub log: Log,
    pub param: Param,
    pub commander: Commander,
    // some fields omitted
}
Expand description

The Crazyflie

This struct is one-time use: Creating it will connect to a Crazyflie and once disconnected, either as requested by the lib user or as a result of a connection loss, the object cannot be reconnected. A new one need to be created to connect again.

See the crazyflie-lib crate root documentation for more context and information.

Fields

log: Log

Log subsystem access

param: Param

Parameter subsystem access

commander: Commander

Commander/setpoint subsystem access

Implementations

Open a Crazyflie connection to a given URI

This function opens a link to the given URI and calls Crazyflie::connect_from_link() to connect the Crazyflie.

The executor argument should be an async executor from the crate async_executors. See example in the crate root documentation.

An error is returned either if the link cannot be opened or if the Crazyflie connection fails.

Connect a Crazyflie using an existing link

Connect a Crazyflie using an existing connected link.

The executor argument should be an async executor from the crate async_executors. See example in the crate root documentation.

This function will return an error if anything goes wrong in the connection process.

Disconnect the Crazyflie

The Connection can be ended in two ways: either by dropping the Crazyflie object or by calling this disconnect() function. Once this function return, the Crazyflie is fully disconnected.

Once disconnected, any methods that uses the communication to the Crazyflie will return the error Error::Disconnected

Wait for the Crazyflie to be disconnected

This function waits for the Crazyflie link to close and for the Crazyflie to fully disconnect. It returns a string describing the reason for the disconnection.

One intended use if to call and block on this function from an async task to detect a disconnection and, for example, update the state of a GUI.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.