|
RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
|
Fuses gyroscope and accelerometer samples into an orientation quaternion. More...
#include <IMUFilter.h>
Public Types | |
| enum | Type { kMadgwick = 0 , kComplementaryFilter = 1 } |
| Orientation fusion algorithm. More... | |
Public Member Functions | |
| virtual void | parseParameters (const ParametersMap ¶meters) |
Re-reads filter parameters from parameters. | |
| void | update (double gx, double gy, double gz, double ax, double ay, double az, double stamp) |
| Integrates one IMU sample and updates the internal orientation estimate. | |
| virtual IMUFilter::Type | type () const =0 |
| virtual void | getOrientation (double &qx, double &qy, double &qz, double &qw) const =0 |
| Current orientation estimate. | |
| virtual void | reset (double qx=0.0, double qy=0.0, double qz=0.0, double qw=1.0)=0 |
| Resets internal state to the given orientation. | |
Static Public Member Functions | |
| static IMUFilter * | create (const ParametersMap ¶meters=ParametersMap()) |
Creates a filter using type parsed from parameters. | |
| static IMUFilter * | create (IMUFilter::Type type, const ParametersMap ¶meters=ParametersMap()) |
Creates a filter of the given type. | |
Protected Member Functions | |
| IMUFilter (const ParametersMap ¶meters=ParametersMap()) | |
Fuses gyroscope and accelerometer samples into an orientation quaternion.
Implementations integrate angular rates and correct drift using the measured gravity vector. The public update() API takes timestamps and computes the time step between consecutive calls.
Factory methods create() return heap-allocated instances; the caller owns the pointer (e.g. SensorCaptureThread, IMUThread, Camera).
Output orientation from getOrientation() is a unit quaternion (qx, qy, qz, qw) in the same convention as IMU (body frame).
Filter tuning parameters are read from ParametersMap (ImuFilter/... keys); see kComplementaryFilter and kMadgwick (the latter only when RTAB-Map is built with Madgwick support).
Definition at line 58 of file IMUFilter.h.
Orientation fusion algorithm.
| Enumerator | |
|---|---|
| kMadgwick | Madgwick AHRS (attitude and heading reference system). RTAB-Map must be built with Madgwick support. |
| kComplementaryFilter | Complementary filter (always available). |
Definition at line 64 of file IMUFilter.h.
|
inlinevirtual |
Definition at line 85 of file IMUFilter.h.
|
inlineprotected |
Definition at line 130 of file IMUFilter.h.
|
static |
Creates a filter using type parsed from parameters.
| parameters | Optional ImuFilter/... tuning parameters. |
|
static |
Creates a filter of the given type.
| type | Fusion algorithm; falls back to kComplementaryFilter if kMadgwick is requested but not compiled in. |
| parameters | Optional ImuFilter/... tuning parameters. |
|
inlinevirtual |
Re-reads filter parameters from parameters.
| parameters | ImuFilter/... keys (implementation-specific). |
Definition at line 91 of file IMUFilter.h.
| void rtabmap::IMUFilter::update | ( | double | gx, |
| double | gy, | ||
| double | gz, | ||
| double | ax, | ||
| double | ay, | ||
| double | az, | ||
| double | stamp | ||
| ) |
Integrates one IMU sample and updates the internal orientation estimate.
| gx | Gyroscope x angular rate (rad/s). |
| gy | Gyroscope y angular rate (rad/s). |
| gz | Gyroscope z angular rate (rad/s). |
| ax | Accelerometer x (m/s²; magnitude ~9.81 when stationary). |
| ay | Accelerometer y (m/s²). |
| az | Accelerometer z (m/s²). |
| stamp | Sample time (seconds); used with the previous stamp to compute dt. |
|
pure virtual |
|
pure virtual |
Current orientation estimate.
| qx | Quaternion x |
| qy | Quaternion y |
| qz | Quaternion z |
| qw | Quaternion w (scalar) |
|
pure virtual |
Resets internal state to the given orientation.
| qx | Quaternion x (default 0) |
| qy | Quaternion y (default 0) |
| qz | Quaternion z (default 0) |
| qw | Quaternion w (default 1, identity) |