Compass
FREEHeading compass from IMU orientation
When to reach for it
Compass renders a heading from an IMU quaternion or a GPS heading message. Use it on outdoor robots that care about absolute orientation, or anywhere a numeric yaw alone is harder to interpret than a needle. For a full pose readout, Pose Display (Pro). For attitude on an aircraft, IMU Display (Pro) has the artificial horizon.
Worked example: mavros IMU heading
Topic /mavros/imu/data, schema sensor_msgs/msg/Imu. Source Auto (detect from topic)detects the Imu schema and reads the quaternion. mavros publishes that orientation pre-rotated into ROS's ENU convention: per REP-103, 0 degrees points East, angles increase counter-clockwise. Compass applies that same convention internally by default, matching Frame Convention's own default of ENU (East-North), though the field itself only appears once Source is set to IMU Quaternion. A raw yaw taken straight off the flight controller, before mavros or a fusion node like robot_localization rotates it, usually needs NED (North-East) or Raw yaw there instead.
Watch out for
- Magnetic declination is not corrected for you. A robot that runs near magnetic structure (a steel building, a hard drive) needs Heading Offset (°) (Pro) to bring the displayed heading back to a useful reference.
- If the compass spins the wrong way during a known clockwise rotation, toggle Invert Direction (Pro) rather than rewiring the IMU axes upstream.
Configuration fields
The topic this widget reads data from. While connected, tap to pick from the topics the robot advertises.
Where to read the heading from. Auto picks IMU or GPS based on the topic's message type.
Which field inside the message to read, as a dot-path, e.g. pose.position.x. Leave blank to use the message main value.
Calibration offset added to the displayed heading.
-180 to 180, step 1WITH PROMost IMUs report heading relative to magnetic north. If the IMU sits at an angle, or you want the compass to read true north (or some other reference like "robot front"), dial the offset in here. Saves rebuilding the URDF or rerouting the IMU frame.
Reverse the rotation sense.
WITH PROFlips clockwise/counter-clockwise. Needed when the IMU is mounted upside-down or when an upstream node has already negated the yaw axis.