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§
Sourcefn 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 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.
Sourcefn calibration_status(&self) -> CalibrationStatus
fn calibration_status(&self) -> CalibrationStatus
Get calibration status
Returns the current calibration state of each sensor component.
Sourcefn 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 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).
Provided Methods§
Sourcefn reset_fusion<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
fn reset_fusion<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
Reset sensor fusion (if supported)
Reset the orientation estimate to a known state.
Sourcefn 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 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
Sourcefn has_magnetometer(&self) -> bool
fn has_magnetometer(&self) -> bool
Check if the IMU has a magnetometer
Sourcefn has_absolute_orientation(&self) -> bool
fn has_absolute_orientation(&self) -> bool
Check if the IMU provides absolute orientation