Monado OpenXR Runtime
|
A simple IMU fusion class. More...
#include <tracking/t_imu_fusion.hpp>
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | SimpleIMUFusion (double gravity_rate=0.9) |
bool | valid () const noexcept |
Eigen::Quaterniond | getQuat () const |
Get the current state orientation. More... | |
Eigen::Vector3d | getRotationVec () const |
Get the current state orientation as a rotation vector. More... | |
Eigen::Matrix3d | getRotationMatrix () const |
Get the current state orientation as a rotation matrix. More... | |
Eigen::Quaterniond | getPredictedQuat (timepoint_ns timestamp) const |
Get the predicted orientation at some point in the future. More... | |
Eigen::Vector3d const & | getAngVel () const |
Get the angular velocity in body space. More... | |
bool | handleGyro (Eigen::Vector3d const &gyro, timepoint_ns timestamp) |
Process a gyroscope report. More... | |
bool | handleAccel (Eigen::Vector3d const &accel, timepoint_ns timestamp) |
Process an accelerometer report. More... | |
Eigen::Vector3d | getCorrectedWorldAccel (Eigen::Vector3d const &accel) const |
Use this to obtain the residual, world-space acceleration in m/s/s not associated with gravity, after incorporating a measurement. More... | |
void | postCorrect () |
Normalize internal state. More... | |
A simple IMU fusion class.
|
inlineexplicit |
gravity_rate | Value in [0, 1] indicating how much the accelerometer should affect the orientation each second. |
|
inline |
Get the angular velocity in body space.
Referenced by imu_fusion::imu_fusion_get_prediction().
|
inline |
Use this to obtain the residual, world-space acceleration in m/s/s not associated with gravity, after incorporating a measurement.
accel | Body-relative acceleration measurement in m/s/s. |
References MATH_GRAVITY_M_S2.
Referenced by imu_fusion::imu_fusion_incorporate_accelerometer(), and imu_fusion::imu_fusion_incorporate_gyros_and_accelerometer().
|
inline |
Get the predicted orientation at some point in the future.
Here, we do not clamp the delta-t, so only ask for reasonable points in the future. (The gyro handler math does clamp delta-t for the purposes of integration in case of long times without signals, etc, which is OK since the accelerometer serves as a correction.)
Referenced by imu_fusion::imu_fusion_get_prediction(), and imu_fusion::imu_fusion_get_prediction_rotation_vec().
|
inline |
Get the current state orientation.
Referenced by imu_fusion::imu_fusion_get_prediction().
|
inline |
Get the current state orientation as a rotation matrix.
|
inline |
Get the current state orientation as a rotation vector.
Referenced by imu_fusion::imu_fusion_get_prediction_rotation_vec().
|
inline |
Process an accelerometer report.
accel | Body-relative acceleration measurement in m/s/s. |
timestamp | Nanosecond timestamp of this measurement. |
Referenced by imu_fusion::imu_fusion_incorporate_accelerometer(), and imu_fusion::imu_fusion_incorporate_gyros_and_accelerometer().
|
inline |
Process a gyroscope report.
gyro | Angular rate in radians per second, in body space. |
timestamp | Nanosecond timestamp of this measurement. |
Referenced by imu_fusion::imu_fusion_incorporate_gyros(), and imu_fusion::imu_fusion_incorporate_gyros_and_accelerometer().
|
inline |
Normalize internal state.
Call periodically, like after you finish handling both the accel and gyro from one packet.
Referenced by imu_fusion::imu_fusion_incorporate_gyros_and_accelerometer().
|
inlinenoexcept |
Referenced by imu_fusion::imu_fusion_get_prediction(), and imu_fusion::imu_fusion_get_prediction_rotation_vec().