|
libstp
Robotics library for Botball
|
#include <IMU.hpp>
Public Member Functions | |
| IMU () | |
| Construct the platform IMU implementation. | |
| ~IMU () override | |
| void | read (float *accel, float *gyro, float *magneto) override |
| Read accel, gyro, and magnetometer data into caller-owned buffers. | |
| void | getAngularVelocity (float *gyro) override |
| Read angular velocity in radians per second into a caller-owned buffer. | |
| void | calibrate () override |
| Run whatever calibration behavior the active platform exposes. | |
| float | getHeading () override |
| Return the current heading in radians using libstp sign conventions. | |
| void | getLinearAcceleration (float *linear_accel) override |
| Read gravity-compensated acceleration into a caller-owned buffer. | |
| void | getQuaternion (float *quat) override |
| Read the DMP fused orientation quaternion [w,x,y,z] into a buffer. | |
| void | getIntegratedVelocity (float *vel) override |
| Read firmware-integrated velocity when the platform provides it. | |
| void | resetIntegratedVelocity () override |
| Reset the platform's integrated-velocity accumulator if supported. | |
| bool | waitForReady (int timeout_ms=1000) override |
| Wait for the platform to report that initial orientation data is ready. | |
| Public Member Functions inherited from libstp::hal::imu::IIMU | |
| virtual | ~IIMU ()=default |
| void | setYawRateAxisMode (const TurnAxisMode mode) |
| Configure which axis getYawRate() reports, using the enum form. | |
| void | setYawRateAxisMode (const std::string &mode) |
| Configure which axis getYawRate() reports, using a string alias. | |
| TurnAxisMode | getYawRateAxisMode () const |
| std::string | getYawRateAxisModeName () const |
| float | getYawRate () |
Static Public Member Functions | |
| static std::shared_ptr< IMU > | instance () |
Concrete IMU wrapper backed by the selected platform bundle.
Higher-level code should depend on IIMU when injection is useful and instantiate IMU when it wants the configured hardware implementation.
| libstp::hal::imu::IMU::IMU | ( | ) |
Construct the platform IMU implementation.
|
override |
|
overridevirtual |
Run whatever calibration behavior the active platform exposes.
Implements libstp::hal::imu::IIMU.
|
overridevirtual |
Read angular velocity in radians per second into a caller-owned buffer.
Reimplemented from libstp::hal::imu::IIMU.
|
nodiscardoverridevirtual |
Return the current heading in radians using libstp sign conventions.
Implements libstp::hal::imu::IIMU.
|
overridevirtual |
Read firmware-integrated velocity when the platform provides it.
Reimplemented from libstp::hal::imu::IIMU.
|
overridevirtual |
Read gravity-compensated acceleration into a caller-owned buffer.
Implements libstp::hal::imu::IIMU.
|
overridevirtual |
Read the DMP fused orientation quaternion [w,x,y,z] into a buffer.
Implements libstp::hal::imu::IIMU.
|
static |
Shared, process-wide IMU handle.
IMU is stateless: every method delegates to the platform TransportReader/MockPlatform singleton. A single instance is therefore sufficient, and reusing it avoids the redundant construction that trips the imuInstanceCreated safety guard. All call sites (Python binding, odometry) should obtain the IMU through this accessor rather than constructing their own.
|
overridevirtual |
Read accel, gyro, and magnetometer data into caller-owned buffers.
Implements libstp::hal::imu::IIMU.
|
overridevirtual |
Reset the platform's integrated-velocity accumulator if supported.
Reimplemented from libstp::hal::imu::IIMU.
|
overridevirtual |
Wait for the platform to report that initial orientation data is ready.
Implements libstp::hal::imu::IIMU.