pub struct LighthouseMemory { /* private fields */ }Expand description
Memory interface for lighthouse configuration data
This provides methods to read and write lighthouse base station geometry and calibration data to the Crazyflie.
Implementations§
Source§impl LighthouseMemory
impl LighthouseMemory
Sourcepub const GEO_START_ADDR: usize = 0x00
pub const GEO_START_ADDR: usize = 0x00
Start address for geometry data
Sourcepub const CALIB_START_ADDR: usize = 0x1000
pub const CALIB_START_ADDR: usize = 0x1000
Start address for calibration data
Sourcepub const MAX_BASE_STATIONS: usize = 16
pub const MAX_BASE_STATIONS: usize = 16
Maximum number of base stations supported
Sourcepub async fn read_geometry(&self, bs_id: u8) -> Result<LighthouseBsGeometry>
pub async fn read_geometry(&self, bs_id: u8) -> Result<LighthouseBsGeometry>
Sourcepub async fn write_geometry(
&self,
bs_id: u8,
geometry: &LighthouseBsGeometry,
) -> Result<()>
pub async fn write_geometry( &self, bs_id: u8, geometry: &LighthouseBsGeometry, ) -> Result<()>
Write geometry data for a specific base station
§Arguments
bs_id- Base station ID (0-15)geometry- The geometry data to write
Sourcepub async fn read_calibration(
&self,
bs_id: u8,
) -> Result<LighthouseBsCalibration>
pub async fn read_calibration( &self, bs_id: u8, ) -> Result<LighthouseBsCalibration>
Sourcepub async fn write_calibration(
&self,
bs_id: u8,
calibration: &LighthouseBsCalibration,
) -> Result<()>
pub async fn write_calibration( &self, bs_id: u8, calibration: &LighthouseBsCalibration, ) -> Result<()>
Write calibration data for a specific base station
§Arguments
bs_id- Base station ID (0-15)calibration- The calibration data to write
Sourcepub async fn read_all_geometries(
&self,
) -> Result<HashMap<u8, LighthouseBsGeometry>>
pub async fn read_all_geometries( &self, ) -> Result<HashMap<u8, LighthouseBsGeometry>>
Read all geometry data from the Crazyflie
Attempts to read geometry for all base stations (0-15). Only base stations with valid data are included in the result.
§Returns
A HashMap mapping base station ID to geometry data
Sourcepub async fn read_all_geometries_with_progress<F>(
&self,
progress_callback: F,
) -> Result<HashMap<u8, LighthouseBsGeometry>>
pub async fn read_all_geometries_with_progress<F>( &self, progress_callback: F, ) -> Result<HashMap<u8, LighthouseBsGeometry>>
Read all geometry data with progress reporting
§Arguments
progress_callback- Called with (completed_count, total_count) after each read
Sourcepub async fn read_all_calibrations(
&self,
) -> Result<HashMap<u8, LighthouseBsCalibration>>
pub async fn read_all_calibrations( &self, ) -> Result<HashMap<u8, LighthouseBsCalibration>>
Read all calibration data from the Crazyflie
Attempts to read calibration for all base stations (0-15). Only base stations with valid data are included in the result.
§Returns
A HashMap mapping base station ID to calibration data
Sourcepub async fn read_all_calibrations_with_progress<F>(
&self,
progress_callback: F,
) -> Result<HashMap<u8, LighthouseBsCalibration>>
pub async fn read_all_calibrations_with_progress<F>( &self, progress_callback: F, ) -> Result<HashMap<u8, LighthouseBsCalibration>>
Read all calibration data with progress reporting
§Arguments
progress_callback- Called with (completed_count, total_count) after each read
Sourcepub async fn write_geometries(
&self,
geometries: &HashMap<u8, LighthouseBsGeometry>,
) -> Result<()>
pub async fn write_geometries( &self, geometries: &HashMap<u8, LighthouseBsGeometry>, ) -> Result<()>
Write geometry data for multiple base stations
§Arguments
geometries- A HashMap mapping base station ID to geometry data
Sourcepub async fn write_geometries_with_progress<F>(
&self,
geometries: &HashMap<u8, LighthouseBsGeometry>,
progress_callback: F,
) -> Result<()>
pub async fn write_geometries_with_progress<F>( &self, geometries: &HashMap<u8, LighthouseBsGeometry>, progress_callback: F, ) -> Result<()>
Write geometry data for multiple base stations with progress reporting
§Arguments
geometries- A HashMap mapping base station ID to geometry dataprogress_callback- Called with (completed_count, total_count) after each write
Sourcepub async fn write_calibrations(
&self,
calibrations: &HashMap<u8, LighthouseBsCalibration>,
) -> Result<()>
pub async fn write_calibrations( &self, calibrations: &HashMap<u8, LighthouseBsCalibration>, ) -> Result<()>
Write calibration data for multiple base stations
§Arguments
calibrations- A HashMap mapping base station ID to calibration data
Sourcepub async fn write_calibrations_with_progress<F>(
&self,
calibrations: &HashMap<u8, LighthouseBsCalibration>,
progress_callback: F,
) -> Result<()>
pub async fn write_calibrations_with_progress<F>( &self, calibrations: &HashMap<u8, LighthouseBsCalibration>, progress_callback: F, ) -> Result<()>
Write calibration data for multiple base stations with progress reporting
§Arguments
calibrations- A HashMap mapping base station ID to calibration dataprogress_callback- Called with (completed_count, total_count) after each write
Trait Implementations§
Source§impl Debug for LighthouseMemory
impl Debug for LighthouseMemory
Source§impl FromMemoryBackend for LighthouseMemory
impl FromMemoryBackend for LighthouseMemory
Source§async fn from_memory_backend(memory: MemoryBackend) -> Result<Self>
async fn from_memory_backend(memory: MemoryBackend) -> Result<Self>
MemoryBackend. When created the
memory is automatically read to populate the fields of the type. Read more