Skip to main content

ImuController

Trait ImuController 

Source
pub trait ImuController: Controller {
    // Required methods
    fn read_imu<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<ImuData, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn calibration_status(&self) -> CalibrationStatus;
    fn calibrate<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<CalibrationData, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save_calibration<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load_calibration<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn reset_fusion<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self::Error: From<ControllerError>,
             Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn temperature<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<f32>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn has_magnetometer(&self) -> bool { ... }
    fn has_absolute_orientation(&self) -> bool { ... }
}
Expand description

IMU (Inertial Measurement Unit) controller trait

Provides a unified interface for different IMU types:

  • 6-DOF IMUs (accelerometer + gyroscope)
  • 9-DOF IMUs (accel + gyro + magnetometer)
  • Absolute orientation sensors with sensor fusion

Required Methods§

Source

fn read_imu<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<ImuData, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read current IMU data

Returns the latest sensor readings including orientation, angular velocity, and linear acceleration.

Source

fn calibration_status(&self) -> CalibrationStatus

Get calibration status

Returns the current calibration state of each sensor component.

Source

fn calibrate<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<CalibrationData, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform sensor calibration

Initiate the calibration process. This may take several seconds and require specific device movements (e.g., figure-8 for magnetometer).

Source

fn save_calibration<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save calibration data to persistent storage

Source

fn load_calibration<'life0, 'life1, 'async_trait>( &'life0 mut self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load calibration data from persistent storage

Provided Methods§

Source

fn reset_fusion<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self::Error: From<ControllerError>, Self: Send + 'async_trait, 'life0: 'async_trait,

Reset sensor fusion (if supported)

Reset the orientation estimate to a known state.

Source

fn temperature<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<f32>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get sensor temperature if available

Source

fn has_magnetometer(&self) -> bool

Check if the IMU has a magnetometer

Source

fn has_absolute_orientation(&self) -> bool

Check if the IMU provides absolute orientation

Implementors§