|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <abstract_imu.hpp>


Classes | |
| struct | ImuData |
Public Member Functions | |
| AbstractIMU (const Transform &mountingTransform=Transform::identity()) | |
| void | setMountingTransform (const Transform &transform) |
| virtual | ~AbstractIMU ()=default |
| virtual void | initialize (float sampleFrequency, float mahonyKp, float mahonyKi) |
| virtual void | requestCalibration () |
| virtual void | periodicIMUUpdate () |
| virtual ImuState | getImuState () const |
| mockable float | getAx () const override |
| mockable float | getAy () const override |
| mockable float | getAz () const override |
| mockable float | getAzMinusG () const |
| mockable float | getGx () const override |
| mockable float | getGy () const override |
| mockable float | getGz () const override |
| mockable float | getTemp () const |
| virtual float | getYaw () const override |
| virtual float | getPitch () const override |
| virtual float | getRoll () const override |
| void | setCalibrationSamples (int sampleCount) |
Public Member Functions inherited from tap::communication::sensors::imu::ImuInterface | |
| virtual const char * | getName () const =0 |
Protected Member Functions | |
| void | resetOffsets () |
| void | computeOffsets () |
| void | setAccelOffset (float x, float y, float z) |
| void | setGyroOffset (float x, float y, float z) |
| void | applyTransform (ImuData &data) |
| virtual float | getAccelerationSensitivity () const =0 |
Protected Attributes | |
| tap::algorithms::transforms::Transform | mountingTransform |
| Mahony | mahonyAlgorithm |
| ImuState | imuState = ImuState::IMU_NOT_CONNECTED |
| int | calibrationSample = 0 |
| int | offsetSampleCount = 1000 |
| ImuData | imuData |
| tap::arch::PeriodicMicroTimer | readTimeout |
| uint32_t | prevIMUDataReceivedTime = 0 |
Additional Inherited Members | |
Public Types inherited from tap::communication::sensors::imu::ImuInterface | |
| enum class | ImuState { IMU_NOT_CONNECTED , IMU_NOT_CALIBRATED , IMU_CALIBRATING , IMU_CALIBRATED } |
A class that represents any directly connected IMU.
|
inline |
|
virtualdefault |
|
inlineprotected |
|
protected |
|
inlineprotectedpure virtual |
|
inlineoverridevirtual |
Returns the linear acceleration in the x direction, in
.
Implements tap::communication::sensors::imu::ImuInterface.
|
inlineoverridevirtual |
Returns the linear acceleration in the y direction, in
.
Implements tap::communication::sensors::imu::ImuInterface.
|
inlineoverridevirtual |
Returns the linear acceleration in the z direction, in
.
Implements tap::communication::sensors::imu::ImuInterface.
|
inline |
|
inlineoverridevirtual |
Returns the gyroscope reading (rotational speed) in the x direction, in
.
Implements tap::communication::sensors::imu::ImuInterface.
|
inlineoverridevirtual |
Returns the gyroscope reading (rotational speed) in the y direction, in
.
Implements tap::communication::sensors::imu::ImuInterface.
|
inlineoverridevirtual |
Returns the gyroscope reading (rotational speed) in the z direction, in
.
Implements tap::communication::sensors::imu::ImuInterface.
|
inlinevirtual |
Returns the state of the IMU. Can be not connected, connected but not calibrated, or calibrated. When not connected, IMU data will be garbage. When not calibrated, IMU data is valid but the computed yaw angle data will drift. When calibrating, the IMU data is invalid. When calibrated, the IMU data is valid and assuming proper calibration the IMU data should not drift.
To be safe, whenever you call the functions below, call this function to ensure the data you are about to receive is not garbage.
|
inlineoverridevirtual |
Returns pitch angle in radians.
Implements tap::communication::sensors::imu::ImuInterface.
|
inlineoverridevirtual |
Returns roll angle in radians.
Implements tap::communication::sensors::imu::ImuInterface.
|
inline |
|
inlineoverridevirtual |
Returns yaw angle. in radians.
Implements tap::communication::sensors::imu::ImuInterface.
|
virtual |
Reimplemented in tap::communication::sensors::imu::bmi088::final_mockable.
|
virtual |
Call this function at same rate as intialized sample frequency. Performs the mahony AHRS algorithm to compute pitch/roll/yaw.
Reimplemented in tap::communication::sensors::imu::bmi088::final_mockable.
|
virtual |
When this function is called, the bmi088 enters a calibration state during which time, gyro/accel calibration offsets will be computed and the mahony algorithm reset. When calibrating, angle, accelerometer, and gyroscope values will return 0. When calibrating the BMI088 should be level, otherwise the IMU will be calibrated incorrectly.
|
protected |
|
protected |
|
inline |
|
protected |
| void tap::communication::sensors::imu::AbstractIMU::setMountingTransform | ( | const Transform & | transform | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |