Overview
ROS2 provides powerful visualization tools to debug robots, view sensor data, and monitor system state. RViz2 visualizes 3D robot models, sensor data, and navigation paths, while rqt offers debugging GUIs for topics, parameters, and graphs.RViz2
3D visualization of robot, sensors, and environment
rqt Tools
Debug topics, plot data, inspect parameters
RViz2
Launching RViz2
Interface Overview
Essential RViz2 Displays
1. RobotModel
Shows robot structure from URDF:2. LaserScan
Visualizes LiDAR data:3. TF
Shows coordinate frame transformations:4. Map
Displays occupancy grid from SLAM:5. Path
Shows planned navigation path:6. Odometry
Visualizes robot position estimates:7. Marker / MarkerArray
For custom visualizations (goals, waypoints, etc.):RViz2 Configuration
Saving Configuration
Loading Configuration in Launch File
rviz.launch.py
Fixed Frame
Global Options → Fixed Frame:- Use
mapfor global visualization (navigation) - Use
odomfor local odometry visualization - Use
base_linkto follow robot (first-person view)
rqt Tools
rqt_graph
Visualize ROS2 computation graph (nodes and topics):- Nodes (ovals)
- Topics (rectangles)
- Connections (arrows)
- Message types
- Understanding system architecture
- Debugging missing connections
- Verifying publish-subscribe relationships
rqt_plot
Plot numeric data over time:- Monitor velocity commands vs actual velocity
- Plot battery voltage over time
- Visualize PID error signals
- Track motor speeds
rqt_console
View log messages from all nodes:- Filter by severity (DEBUG, INFO, WARN, ERROR, FATAL)
- Filter by node name
- Search log messages
- Export logs to file
rqt_topic
Monitor topic data in real-time:- View all active topics
- See message types and publishers
- Echo topic data (like
ros2 topic echo) - Plot numeric fields
rqt_reconfigure
Dynamically adjust node parameters:- View all dynamic parameters
- Adjust parameters with sliders/checkboxes
- Changes apply immediately (no restart)
- Useful for tuning PID, speeds, thresholds
rqt_image_view
Display camera images:- Select camera topic from dropdown
- View compressed or raw images
- Zoom, pan, adjust brightness
Plotting with PlotJuggler
PlotJuggler is a more advanced alternative to rqt_plot:Installation
Usage
- Multiple subplots
- Zoom, pan, measure
- Save and replay data
- Export to CSV/image
Command-Line Visualization
Viewing LaserScan ASCII Art
Monitoring Topic Hz
Bandwidth Usage
Topic Info
Custom Markers for Visualization
Publish markers to display custom data in RViz:waypoint_visualizer.py
ARROW,CUBE,SPHERE,CYLINDERLINE_STRIP,LINE_LISTPOINTSTEXT_VIEW_FACINGMESH_RESOURCE(load custom 3D models)
Best Practices
Performance
- Limit LaserScan decay time (0-2 seconds)
- Reduce path buffer length (10-100)
- Disable unused displays
- Lower update rate for slow computers
Organization
- Save RViz configs for different tasks (mapping, navigation, debug)
- Use descriptive display names
- Group related displays
- Document Fixed Frame choice
Debugging
- Check Fixed Frame if nothing appears
- Verify topic names match (case-sensitive!)
- Use rqt_graph to find missing connections
- Monitor rqt_console for errors
Efficiency
- Use rqt_plot for quick checks
- Use PlotJuggler for analysis
- Save data with
ros2 bag record - Export plots for reports
Recording and Playback
Record Topics
Playback
- Record data during robot operation
- Play back offline
- Visualize in RViz without robot running
- Debug and analyze at your own pace
Troubleshooting
RViz shows empty 3D view
RViz shows empty 3D view
Solutions:
- Check Fixed Frame is set to existing frame (e.g.,
base_link,map) - Add displays (RobotModel, LaserScan, etc.)
- Verify nodes are publishing data:
- Reset camera: Views → Reset Camera
RobotModel not visible
RobotModel not visible
Solutions:
-
Verify
robot_state_publisheris running: -
Check
robot_descriptionparameter: -
Verify TF tree is complete:
-
In RViz: RobotModel → Description Topic →
/robot_description
LaserScan not showing
LaserScan not showing
Solutions:
-
Check topic name matches:
-
Verify scan is being published:
-
In RViz: LaserScan → Topic → Select
/scan -
Check Fixed Frame is appropriate (e.g.,
odomormap)
rqt_plot shows no data
rqt_plot shows no data
Solutions:
-
Ensure topic is publishing numeric data:
-
Use full field path:
/odom/pose/pose/position/x - Check topic type supports plotting (must have numeric fields)
- Try PlotJuggler as alternative
Next Steps
ROS2 Architecture
Understand nodes, topics, and services
TF Transforms
Visualize coordinate frames in RViz
Navigation
Visualize Nav2 paths and costmaps
SLAM
Visualize map creation in real-time