A RViz2 display plugin that transforms complex quaternion data into intuitive visual feedback. Designed for roboticists who need to quickly understand and troubleshoot orientation data from IMUs, sensor fusion algorithms, and navigation systems.
Quaternions are mathematically elegant but notoriously difficult to interpret at a glance.
This plugin bridges that gap with aviation-style attitude indicators and real-time Euler angle conversion, making it easy to debug sensor data, validate algorithms, and monitor robot behavior.
- 🧭 Artificial horizon & heading indicator - Aviation-style gauges for immediate spatial awareness
- 🎯 Euler angle readouts - Real-time Roll, Pitch, Yaw values in degrees or radians
- 📡 8+ message types - IMU, Odometry, Pose, PoseWithCovariance, Quaternion messages
- 🎨 Customizable overlay - Adjustable position, size, and transparency
- ⚡ Lightweight performance - Efficient overlay rendering with minimal overhead
- Ubuntu: 22.04+
- ROS 2: Humble+
-
Clone the repository into your ROS2 workspace:
cd ~/colcon_ws/src git clone https://github.com/amgaber95/rviz_attitude_plugin.git
-
Install dependencies:
cd ~/colcon_ws rosdep install --from-paths src --ignore-src -r -y
-
Build the package:
colcon build --packages-select rviz_attitude_plugin
-
Source the workspace:
source ~/colcon_ws/install/setup.bash
-
Launch RViz2:
rviz2
-
Add the Attitude Display:
- Press
Ctrl+Nor click the Add button in the Displays panel - Navigate to
rviz_attitude_plugin→Attitude - Click OK
- Press
-
Configure the display:
- Select your orientation topic from the Topic dropdown in the display properties
- Click the 🔄 Refresh button to update the topics list if your topic doesn't appear
- Adjust visual settings as needed
The plugin automatically extracts quaternion data from these ROS2 message types:
| Message Type | Quaternion Source |
|---|---|
geometry_msgs/msg/Quaternion |
Direct quaternion |
geometry_msgs/msg/QuaternionStamped |
.quaternion |
geometry_msgs/msg/Pose |
.orientation |
geometry_msgs/msg/PoseStamped |
.pose.orientation |
geometry_msgs/msg/PoseWithCovariance |
.pose.orientation |
geometry_msgs/msg/PoseWithCovarianceStamped |
.pose.pose.orientation |
sensor_msgs/msg/Imu |
.orientation |
nav_msgs/msg/Odometry |
.pose.pose.orientation |
Note: The plugin uses TF2's
getRPY()method for quaternion to Euler conversion, following the standard ROS convention (RPY with extrinsic XYZ rotation).
- Click the 🔄 Refresh button in the Topic property
- Ensure your node is publishing messages:
ros2 topic echo /your_topic - Verify the message type is supported (see table above)
- Check that Show Overlay is enabled in the properties
- Adjust Overlay X and Overlay Y positions if it's off-screen
- Verify your topic is publishing:
ros2 topic hz /your_topic
- Confirm your quaternion follows ROS conventions (right-handed, Hamilton convention)
- Check if the data needs coordinate frame transformation
- Verify the message timestamp is recent (stale data may not update)
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome. Please feel free to submit issues or pull requests.
Abdelrahman Mahmoud
📧 Email: abdulrahman.mahmoud1995@gmail.com
🐙 GitHub: @amgaber95
