Coordinates, Mounting & Zeroing
Coordinate Frames & Attitude Conventions
Three right-handed coordinate frames are used (positive rotations follow the right-hand rule):
| Frame | Definition |
|---|---|
| Sensor frame | X / Y / Z arrows printed on the enclosure or PCB; the reference for URFR. |
| Body frame (b-frame) | Output data frame. URFR aligns the sensor to the vehicle; COORD selects Right-Front-Up (RFU, default) or Front-Left-Up (FLU, ROS). |
| World frame (n-frame) | Attitude reference frame. East-North-Up (ENU: X east, Y north, Z up) under COORD 0; in 6-axis mode without magnetic reference, the power-up heading sets the horizontal reference. |
Both Euler angles and quaternions represent the body-to-world rotation
| Output Axes | Body Frame | Euler Sequence | Roll About | Pitch About | Yaw About | Nose Up Pitch | Right Side Down Roll |
|---|---|---|---|---|---|---|---|
COORD 0 (default) | RFU | 312 (Z → X → Y) | Y axis | X axis | Z axis | Positive | Positive |
COORD 4 (ROS) | FLU | 321 (Z → Y → X) | X axis | Y axis | Z axis | Negative | Positive |
Heading Convention
- 6-axis mode:
yawis relative heading, starting at 0° on power-up and drifting slowly over time. - 9-axis mode:
yawreferences magnetic north (keepCOORD 0), with 0° pointing to magnetic north. Apply local magnetic declination on the host if true north is needed. - Sign difference: HI91, HI83, Modbus
YAW, and bytes 4–7 of J19390xFF41carry rawyaw(±180°, counter-clockwise positive from above). Bytes 0–3 of J19390xFF41carry compass heading (0–360°, clockwise positive: 0° magnetic north, 90° east in 9-axis mode).
Output Axes (COORD)
CONFIG IMU COORD <VAL>| VAL | Convention | X / Y / Z Axes | Use Case |
|---|---|---|---|
0 | Right-Front-Up (RFU, default) | Right / Front / Up | All modes (keep 0 for 9-axis and MRU) |
4 | ROS (REP-103, FLU) | Front / Left / Up | 6-axis ROS integration (acc, gyro, mag, and attitude all output in FLU) |
Requires SAVECONFIG and REBOOT (Modbus register 0x0007, J1939 parameter 0x0007). Inclination and compass heading are always computed in Right-Front-Up regardless of COORD.
For ROS, select CONFIG IMU COORD 4. The official ROS driver publishes module output verbatim (frame_id defaults to imu_link). Because URFR compensates mounting inside the module, do not add extra rotation in the base_link → imu_link static TF; see ROS driver notes.
Mounting Orientation (URFR)
When the module is not mounted flat and forward, use the 3-digit decimal code URFR to state where the printed X, Y, and Z arrows point on the vehicle (Front = nose, Right = vehicle right):
CONFIG IMU URFR <CODE>Default is 024 (LOG USRCONFIG omits the leading zero and prints URFR=24). Requires SAVECONFIG and REBOOT. For Modbus / CAN register 0x00A6, write the hex DATA column (the decimal code expressed in hex).
All 24 right-handed mounting codes (write only values from this table):
| Printed Arrows (X, Y, Z) | Code | DATA (Hex) | Printed Arrows (X, Y, Z) | Code | DATA (Hex) |
|---|---|---|---|---|---|
| Right, Front, Up (default) | 024 | 0018 | Front, Left, Up (+90° CCW) | 304 | 0130 |
| Right, Back, Down (inverted) | 035 | 0023 | Back, Left, Down | 315 | 013B |
| Right, Down, Front | 043 | 002B | Down, Left, Front | 341 | 0155 |
| Right, Up, Back | 052 | 0034 | Up, Left, Back | 350 | 015E |
| Left, Front, Down | 125 | 007D | Front, Up, Right | 402 | 0192 |
| Left, Back, Up (180° yaw) | 134 | 0086 | Back, Down, Right | 413 | 019D |
| Left, Up, Front | 142 | 008E | Down, Front, Right | 421 | 01A5 |
| Left, Down, Back | 153 | 0099 | Up, Back, Right | 430 | 01AE |
| Front, Right, Down | 205 | 00CD | Front, Down, Left | 503 | 01F7 |
| Back, Right, Up (−90° CW) | 214 | 00D6 | Back, Up, Left | 512 | 0200 |
| Up, Right, Front | 240 | 00F0 | Up, Front, Left | 520 | 0208 |
| Down, Right, Back | 251 | 00FB | Down, Back, Left | 531 | 0213 |
After reboot, read back URFR and COORD and verify signs by hand:
- Pitch nose up:
pitchis positive inCOORD 0, negative inCOORD 4. - Tilt right side down:
rollis positive. - Rotate counter-clockwise viewed from above:
yawincreases.
Attitude Zeroing & Leveling (ATT RST)
Removes small mechanical tilt offsets or sets a custom reference zero. Keep the vehicle stationary with MAIN_STATUS.ATT_CONV = 0 (see Status Word) before running:
CONFIG ATT RST <VAL>| VAL | Action | Use Case | Needs SAVECONFIG |
|---|---|---|---|
0 | Zero all: zeros roll/pitch and sets current heading as yaw 0° | Custom 9-axis heading zero (yaw no longer points to magnetic north) | Yes |
1 | Temporarily zero internal yaw (keeps saved offset) | Reset 6-axis heading to 0° for the current session | No (cleared on reboot) |
2 | Relative zero: zeros roll/pitch only, keeps heading | Remove mounting tilt / inclinometer zero (9-axis keeps magnetic north) | Yes |
3 | Auto-level (effective only when both roll and pitch are within ±5°) | Fine trim of small residual tilt | Yes |
5 | Clear saved zero offset and restore raw attitude | Reset before changing mounting or mode | Yes |
Modbus register 0x00A5 and J1939 parameter 0x00A5 provide the same function. Verify roll and pitch read near 0° afterward. Use RST 2/RST 3 when you only need leveling; if RST 0 was used earlier, re-run RST 0 to re-level.
Configuration Order
After changing URFR, COORD, or operating mode — or after a firmware upgrade or factory reset — configure in this order:
- Set
URFR,COORD, and operating mode →SAVECONFIG→REBOOT. - Read back
LOG USRCONFIGand verify the three hand-tilt checks above. - Send
CONFIG ATT RST 5to clear stale offsets, then runRST 2/RST 3/RST 0as needed andSAVECONFIG.
312 Attitude Conversions (COORD 0)
The default frame COORD 0 (RFU / ENU) uses the 312 (Z → X → Y) Euler sequence, not the aerospace/ROS 321 sequence. Do not apply 321 formulas to COORD 0 data.
Quaternion
Euler angles to quaternion (
Because
