RQT Setup in ROS2 Humble
In this guide, we’ll walk through:
-
Installing RQT in ROS 2 Humble
-
Running a basic Turtlesim demo
-
Using RQT plugins like
rqt_graph
,rqt_plot
, andrqt_console
Let’s get started.
Prerequisites
Before we dive in, make sure:
-
You’re using Ubuntu 22.04
-
You’ve installed ROS 2 Humble
-
Your environment is sourced properly:
1. Introduction
RQT is a GUI framework for ROS (Robot Operating System) that allows users to create and manage plugins for visualization, debugging, and system introspection. In ROS 2, RQT has been adapted to work with the new middleware and tools.
2. Installing RQT in ROS 2
RQT is included in the default ROS 2 installation but can be installed separately if needed.
2.1 Install RQT Core Packages
Run the following command:
sudo apt install ros-humble-rqt*
Alternatively, install only essential RQT packages:
sudo apt install ros-humble-rqt-gui ros-humble-rqt-common-plugins
2.2 Verify Installation
Check if RQT is installed correctly:
ros2 pkg xml rqt_gui | grep version
(Should display the installed version.)
- Use arrow keys to move the turtle around
- Use arrow keys to move the turtle around
4. Launch RQT
Now let’s visualize what’s going on behind the scenes.
rqt
This opens the RQT GUI.
turtlesim
and teleop_turtle
are communicating.Oval represents a node
Rectangles with arrows pointing towards them are topics.
Subscribers turn Green when you hover over a topic or node. The node or topic being hovered over turns red
Publishers turn Blue.
6. Loading RQT Plugins
RQT provides various plugins for debugging and visualization:
Topic Monitor (
rqt_topic
)Node Graph (
rqt_graph
)Service Caller (
rqt_service_caller
)Bag Tools (
rqt_bag
)Console (
rqt_console
)Plot (
rqt_plot
)Image View (
rqt_image_view
)
To load a plugin:
Open RQT (
rqt
).Go to Plugins > Select desired plugin.
Common RQT Plugins in ROS 2
1. Topic Monitor (rqt_topic
)
Monitors active topics and message rates.
Launch via:
ros2 run rqt_topic rqt_topic
Or go to Plugins>Topics>Topic Monitor
rqt_graph
)Visualizes ROS 2 node communication.
Launch via:
ros2 run rqt_graph rqt_graph
Or go to Plugins>Introspection>Node Graph
3. Service Caller (rqt_service_caller
)
Allows calling ROS 2 services interactively.
Launch via:
ros2 run rqt_service_caller rqt_service_caller
Or go to Plugins>Services>Service Caller
4. Plot (`rqt_plot)
Plots numerical topic data in real-time.
Launch via:
ros2 run rqt_plot rqt_plot
Or go to Plugins>Visualization>Plot
5. Image View (rqt_image_view
)
Displays image topics (from
sensor_msgs/Image
).Launch via:
ros2 run rqt_image_view rqt_image_view
Or go to Plugins>Visualization>Image View
7. Troubleshooting
RQT not opening?
Ensure ROS 2 is sourced (
source /opt/ros/<distro>/setup.bash
).
ReinstallPlugins missing?
sudo apt install ros-humble-rqt-common-plugins
Python errors when launching RQT?
Make sure all Python dependencies are installed usingrosdep
:
sudo rosdep init
rosdep update
Navigate to your workspace and run:
rosdep install -y --from-paths src --ignore-src
This resolves missing system dependencies required by your ROS 2 packages, including RQT plugins.
- Empty Node Graph?
- Ensure the nodes are running and your ROS environment is sourced in the same shell.
Conclusion
RQT offers powerful GUI tools that simplify your ROS 2 development experience. Whether you're debugging, visualizing, or tuning—RQT should be part of your workflow.
Next time your robot misbehaves, don’t panic—just open RQT.
Happy coding!
Comments
Post a Comment