imu_to_pose6D
Converts the orientation quaternion of an IMU or AHRS to pose6D, whatever the sensor.
Processing
- The quaternion is normalized and converted to a rotation matrix, then to roll, pitch and yaw (R = Rz(yaw) Ry(pitch) Rx(roll)).
- With reference_frame = NED the rotation is converted to world ENU and body FLU: the roll keeps its sign, the pitch changes its sign and yaw = 90 deg - heading.
- The output carries the timestamp of the input.
- Sensor fusion is not done here: use a sensor that outputs its orientation, or imu_orientation_estimator.
Data format
- quaternion must have 4 elements; other sizes stop the component with an error.
- pose6D is [0, 0, 0, roll, pitch, yaw] in m and rad. The translation is always 0 because an IMU cannot measure a position.
Notes
- A sample that is not finite, or with a norm below 1e-6, is skipped; a warning is reported once.
- The output is the orientation of the IMU itself. Apply the mounting of the IMU, from Sensor Calibration File Parser, where the orientation is used.
- The reference of the yaw depends on the sensor; a 6-axis sensor drifts in yaw.
References
- [1] T. Foote and M. Purvis, REP 103: Standard Units of Measure and Coordinate Conventions, ROS Enhancement Proposals. https://www.ros.org/reps/rep-0103.html — Used for: world ENU and body FLU axes, units.
- [2] REP 145: Conventions for IMU Sensor Drivers, ROS Enhancement Proposals. https://www.ros.org/reps/rep-0145.html — Used for: conventions of the orientation given by IMU drivers.
- [3] sensor_msgs/Imu message definition, ROS common_msgs. https://docs.ros.org/en/api/sensor_msgs/html/msg/Imu.html — Used for: xyzw order of the quaternion.
Properties
| Name | Default | Description |
|---|---|---|
quaternion_order | wxyz | Order of the elements: wxyz (scalar first) or xyzw (scalar last, as in ROS sensor_msgs/Imu). Options: wxyz, xyzw. |
reference_frame | ENU | Frame of the input: ENU (world ENU, body FLU, as in ROS) or NED (world NED, body FRD). Options: ENU, NED. |
Outputs
| Name | Description |
|---|---|
pose6D | Orientation of the IMU: [0, 0, 0, roll, pitch, yaw] (m, rad). Type: Float64 |
Inputs
| Name | Description |
|---|---|
quaternion | Orientation quaternion (4 elements), in the order set by quaternion_order. Type: Float64 |
RTMaps Toolkits Documentation