|
| bool | getAccel (float *const ax, float *const ay, float *const az) const |
| | Latest accelerometer reading (G)
|
| |
| bool | getGyro (float *const gx, float *const gy, float *const gz) const |
| | Latest gyroscope reading (dps)
|
| |
| bool | getMag (float *const mx, float *const my, float *const mz) const |
| | Latest magnetometer reading (uT)
|
| |
| bool | getTemp (float *const t) const |
| | Latest temperature reading (degC)
|
| |
| void | getImuData (imu_data_t *const data) const |
| | Copy the latest accel/gyro/mag sample into an imu_data_t.
|
| |
| const imu_data_t & | getImuData () |
| | Latest accel/gyro/mag sample, by const reference.
|
| |
| void | getAhrsData (float *const pitch, float *const roll, float *const yaw) const |
| | Current fused attitude as aerospace Euler angles (degrees)
|
| |
|
bool | getAccelData (float *const ax, float *const ay, float *const az) const |
| | Alias for getAccel()
|
| |
|
bool | getGyroData (float *const gx, float *const gy, float *const gz) const |
| | Alias for getGyro()
|
| |
|
bool | getGyroMag (float *const mx, float *const my, float *const mz) const |
| | Alias for getMag() (name mirrors m5::IMU_Class::getGyroMag)
|
| |
| bool | isEnabled () const |
| | Whether accelerometer and gyroscope sources are both registered.
|
| |
| void | setCalibration (const uint8_t accel_strength, const uint8_t gyro_strength, const uint8_t mag_strength) |
| | Set per-capability auto-calibration strength (0 = off, 1-255 = adjustment speed)
|
| |
| void | clearOffsetData () |
| | Zero every capability's auto-calibration offset.
|
| |
| bool | setAxisOrder (const axis_t axis0, const axis_t axis1, const axis_t axis2) |
| | Assign which signed source axis feeds each output slot.
|
| |
| bool | setAxisOrderRightHanded (const axis_t axis0, const axis_t axis1) |
| | Assign the first two output axes; derive the third as a right-handed frame.
|
| |
| bool | setAxisOrderLeftHanded (const axis_t axis0, const axis_t axis1) |
| | Assign the first two output axes; derive the third as a left-handed frame.
|
| |
|
| AhrsController () |
| | Construct with no sources and the default filter (Complementary)
|
| |
|
| ~AhrsController () |
| | Destructor.
|
| |
|
| AhrsController (const AhrsController &)=delete |
| | Copy construction is disabled (holds pointers to registered sources)
|
| |
|
AhrsController & | operator= (const AhrsController &)=delete |
| | Copy assignment is disabled (holds pointers to registered sources)
|
| |
| bool | add (IMUDataSource &src) |
| | Register an IMU data source.
|
| |
| bool | writeAxisOrder (const IMUDataSource &src, const AxisOrder &order) |
| | Set the chip-frame-to-body-frame axis remap applied to one source's Accel/Gyro (and Temp) samples.
|
| |
| bool | readAxisOrder (const IMUDataSource &src, AxisOrder &out) const |
| | Read back the Accel/Gyro axis remap currently configured for one source.
|
| |
| bool | writeMagAxisOrder (const IMUDataSource &src, const AxisOrder &order) |
| | Set the chip-frame-to-body-frame axis remap applied to one source's Mag samples.
|
| |
| bool | readMagAxisOrder (const IMUDataSource &src, AxisOrder &out) const |
| | Read back the Mag-only axis remap currently configured for one source.
|
| |
| void | writeUserAxisOrder (const AxisOrder &order) |
| | Set a global user axis remap composed on top of every source's fixed order.
|
| |
| void | readUserAxisOrder (AxisOrder &out) const |
| | Read back the current global user axis remap.
|
| |
| void | writeAutoCalibration (const uint8_t accel, const uint8_t gyro, const uint8_t mag) |
| | Enable/disable continuous background auto-calibration per capability.
|
| |
| void | readAutoCalibration (uint8_t &accel, uint8_t &gyro, uint8_t &mag) const |
| | Read back the current auto-calibration strengths.
|
| |
| void | writeMagCalibrationRadius (const float radius_ut) |
| | Pin the field strength the magnetometer auto-calibration fits its samples to.
|
| |
| float | readMagCalibrationRadius () const |
| | Field strength the magnetometer auto-calibration is currently fitting to.
|
| |
| bool | calibrateGyro (const uint32_t duration_ms) |
| | Collect gyro samples for the given duration (real clock) and set the gyro offset to their mean.
|
| |
| bool | calibrateGyro (const uint32_t update_count, const float dt) |
| | Deterministic sibling of calibrateGyro(const uint32_t): explicit dt instead of the real clock.
|
| |
| bool | readCalibration (calibration_data_t &out) const |
| | Snapshot every capability's current auto-calibration offset.
|
| |
| bool | writeCalibration (const calibration_data_t &data) |
| | Overwrite every capability's auto-calibration offset from a snapshot.
|
| |
| bool | begin () |
| | Prepare this controller for update()
|
| |
| Capability | update () |
| | Drain every source and fuse newly-arrived samples, measuring dt from the real clock (m5::utility::micros())
|
| |
| Capability | update (const float dt) |
| | Drain every source and fuse newly-arrived samples using an explicit dt.
|
| |
| bool | sleep () |
| | Put every added source into its lowest reversible power state.
|
| |
| bool | wakeup () |
| | Bring every added source back from sleep()
|
| |
| bool | selectFilter (const FilterType type) |
| | Select and internally construct one of the built-in filters.
|
| |
| void | setFilter (AhrsFilterBase &filter) |
| | Inject an externally-owned filter.
|
| |
|
AhrsFilterBase * | filter () const |
| | Currently active filter, or nullptr if none has been selected yet.
|
| |
| void | quaternion (float &w, float &x, float &y, float &z) const |
| | Current fused attitude.
|
| |
| void | euler (float &roll_deg, float &pitch_deg, float &yaw_deg) const |
| | Current fused attitude as aerospace ZYX Euler angles.
|
| |
| void | tareYaw () |
| | Zero the publicly reported yaw at the current heading.
|
| |
| void | clearYawTare () |
| | Remove a previously applied tareYaw() offset.
|
| |
|
const imu_physical_data_t & | latest () const |
| | Most recently fused physical-unit sample.
|
| |
|
bool | hasAccel () const |
| | Whether an accelerometer source has been registered (see add())
|
| |
|
bool | hasGyro () const |
| | Whether a gyroscope source has been registered (see add())
|
| |
|
bool | hasTemp () const |
| | Whether a temperature source has been registered (see add())
|
| |
| bool | hasValidMag () const |
| | Whether at least one valid magnetometer sample has been seen.
|
| |
| unsigned long | lastMicros () const |
| | Microsecond timestamp of the most recent self-clocked update()
|
| |
AhrsController plus an M5Unified IMU_Class-compatible API.
Use this in place of AhrsController when porting M5Unified M5.Imu code: it is-a AhrsController (so it plugs into presets, add(), selectFilter(), etc. unchanged) and additionally exposes getAccel/getGyro/getMag/getTemp/getImuData/getAhrsData/setCalibration. The getters read the already axis-corrected, offset-compensated latest() sample; setCalibration forwards to writeAutoCalibration(); getAhrsData() provides the attitude output for the getAhrsData() slot that M5Unified's IMU_Class declares but does not implement.