Lighthouse

Struct Lighthouse 

Source
pub struct Lighthouse { /* private fields */ }
Expand description

Lighthouse positioning system interface

Provides functionality to receive lighthouse sweep angle data and manage lighthouse base station configuration persistence.

Implementations§

Source§

impl Lighthouse

Source

pub async fn angle_stream(&self) -> impl Stream<Item = LighthouseAngleData>

Get a stream of lighthouse angle measurements

Returns a Stream that yields LighthouseAngleData whenever lighthouse sweep angle data is received from the Crazyflie. This is typically used for lighthouse base station calibration and geometry estimation.

To enable the angle stream, set the parameter locSrv.enLhAngleStream to 1 on the Crazyflie.

§Example
// Enable angle streaming
crazyflie.param.set("locSrv.enLhAngleStream", 1u8).await?;

let mut angle_stream = crazyflie.localization.lighthouse.angle_stream().await;
while let Some(data) = angle_stream.next().await {
    println!("Base station {}: x={:?}, y={:?}",
        data.base_station, data.angles.x, data.angles.y);
}
Source

pub async fn persist_lighthouse_data( &self, geo_list: &[u8], calib_list: &[u8], ) -> Result<bool>

Persist lighthouse geometry and calibration data to permanent storage

Sends a command to persist lighthouse geometry and/or calibration data to permanent storage in the Crazyflie, then waits for confirmation. The geometry and calibration data must have been previously written to RAM via the memory subsystem.

§Arguments
  • geo_list - List of base station IDs (0-15) for which to persist geometry data
  • calib_list - List of base station IDs (0-15) for which to persist calibration data
§Returns
  • Ok(true) if data was successfully persisted
  • Ok(false) if persistence failed
  • Err if there was a communication error or timeout (5 seconds)
§Example
// Persist geometry for base stations 0 and 1, calibration for base station 0
let success = crazyflie.localization.lighthouse
    .persist_lighthouse_data(&[0, 1], &[0]).await?;

if success {
    println!("Data persisted successfully");
}

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.