Skip to content

Coordinates, Mounting & Zeroing ​

Coordinate Frames & Attitude Conventions ​

Three right-handed coordinate frames are used (positive rotations follow the right-hand rule):

FrameDefinition
Sensor frameX / 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 Qb2n (quaternion order WXYZ, scalar q0 first). Near ±90° pitch, Euler angles encounter gimbal lock — use quaternions directly for full-attitude applications.

COORD 0 (RFU) vs COORD 4 (FLU) body frames
Output AxesBody FrameEuler SequenceRoll AboutPitch AboutYaw AboutNose Up PitchRight Side Down Roll
COORD 0 (default)RFU312 (Z → X → Y)Y axisX axisZ axisPositivePositive
COORD 4 (ROS)FLU321 (Z → Y → X)X axisY axisZ axisNegativePositive

Heading Convention ​

  • 6-axis mode: yaw is relative heading, starting at 0° on power-up and drifting slowly over time.
  • 9-axis mode: yaw references magnetic north (keep COORD 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 J1939 0xFF41 carry raw yaw (±180°, counter-clockwise positive from above). Bytes 0–3 of J1939 0xFF41 carry compass heading (0–360°, clockwise positive: 0° magnetic north, 90° east in 9-axis mode).

Output Axes (COORD) ​

text
CONFIG IMU COORD <VAL>
VALConventionX / Y / Z AxesUse Case
0Right-Front-Up (RFU, default)Right / Front / UpAll modes (keep 0 for 9-axis and MRU)
4ROS (REP-103, FLU)Front / Left / Up6-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):

text
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)CodeDATA (Hex)Printed Arrows (X, Y, Z)CodeDATA (Hex)
Right, Front, Up (default)0240018Front, Left, Up (+90° CCW)3040130
Right, Back, Down (inverted)0350023Back, Left, Down315013B
Right, Down, Front043002BDown, Left, Front3410155
Right, Up, Back0520034Up, Left, Back350015E
Left, Front, Down125007DFront, Up, Right4020192
Left, Back, Up (180° yaw)1340086Back, Down, Right413019D
Left, Up, Front142008EDown, Front, Right42101A5
Left, Down, Back1530099Up, Back, Right43001AE
Front, Right, Down20500CDFront, Down, Left50301F7
Back, Right, Up (−90° CW)21400D6Back, Up, Left5120200
Up, Right, Front24000F0Up, Front, Left5200208
Down, Right, Back25100FBDown, Back, Left5310213

After reboot, read back URFR and COORD and verify signs by hand:

  1. Pitch nose up: pitch is positive in COORD 0, negative in COORD 4.
  2. Tilt right side down: roll is positive.
  3. Rotate counter-clockwise viewed from above: yaw increases.

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:

text
CONFIG ATT RST <VAL>
VALActionUse CaseNeeds SAVECONFIG
0Zero all: zeros roll/pitch and sets current heading as yaw 0°Custom 9-axis heading zero (yaw no longer points to magnetic north)Yes
1Temporarily zero internal yaw (keeps saved offset)Reset 6-axis heading to 0° for the current sessionNo (cleared on reboot)
2Relative zero: zeros roll/pitch only, keeps headingRemove mounting tilt / inclinometer zero (9-axis keeps magnetic north)Yes
3Auto-level (effective only when both roll and pitch are within ±5°)Fine trim of small residual tiltYes
5Clear saved zero offset and restore raw attitudeReset before changing mounting or modeYes

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:

  1. Set URFR, COORD, and operating mode → SAVECONFIG → REBOOT.
  2. Read back LOG USRCONFIG and verify the three hand-tilt checks above.
  3. Send CONFIG ATT RST 5 to clear stale offsets, then run RST 2 / RST 3 / RST 0 as needed and SAVECONFIG.

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 Qb2n=[q0,q1,q2,q3]T to Euler angles (radians):

pitch=arcsin⁡(2(q0q1+q2q3))roll=−atan2(2(q1q3−q0q2), q02−q12−q22+q32)yaw=−atan2(2(q1q2−q0q3), q02−q12+q22−q32)

Euler angles to quaternion (cp=cos⁡pitch2, sp=sin⁡pitch2; same for cr/sr and cy/sy):

q0=cpcrcy−spsrsyq1=spcrcy−cpsrsyq2=cpsrcy+spcrsyq3=cpcrsy+spsrcy

Because q and −q represent the same orientation, match the sign of q0 when comparing against test vectors.

Last updated:

IMU · AHRS · INS · RTK Support Center