Compass

FREE
SENSORS · 10 FIELDS · 2×2 DEFAULT
42°

Heading compass from IMU, odometry or pose orientation

When to reach for it

Compass renders a heading from an orientation (an IMU, odometry or pose topic) or a GPS heading message. Style picks the look: a dial (the default), a heading-up dial, a tape, a number, a pixel arrow or a diamond ripple; Show Degrees and Show N/E/S/W Labels belong to the dial. 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 by default: Frame Convention starts on ENU (East-North). 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

Topictopic

The topic this widget reads from. While connected, tap to pick one the robot advertises.

Sourceselect

Auto picks orientation or GPS heading from the topic's message type.

Auto (detect from topic)Orientation (IMU, odometry or pose)GPS Heading
Heading Field Pathfield-path

Dot-path to the field to read, like pose.position.x. Blank uses the message's main value.

Max Message Rate (Hz)number

Messages per second this widget takes from the topic. Lower saves data, higher shows more.

0.1 to 60, step 0.1
Frame Conventionselect

ENU is the ROS standard. On odometry or a pose topic, north is real only if that frame is aligned to the earth (GPS or a compass); otherwise the heading is relative to where the robot started.

ENU (East-North)NED (North-East)Raw yaw
Heading Offset (°)PROslider

Calibration offset added to the displayed heading.

-180 to 180, step 1

WITH PROAlign the compass to true north or the robot's front without changing the URDF.

Invert DirectionPROboolean

Reverse the rotation sense.

WITH PROFix a compass that turns backward, such as from an upside-down IMU.

Styleselect

Every style points at the same heading and prints it in degrees, and says No orientation when a message carries none. Dial is the default, and the only style that Show Degrees and Show N/E/S/W Labels change.

Live preview
42°
Dial
042NE
Heading up
042°NE
Tape
Northeast
042°
Numeric
042°NE
Pixel arrow
NE
042°
Diamond ripple
Show Degreesboolean
Show N/E/S/W Labelsboolean