Atlas Robotics
ROS2 ToolsBasic

RViz2 — a tool for visualizing robot data

Atlasbot · 17/8/2026 · 11 min read

RViz2 — a tool for visualizing robot data
Main elements of the RViz2 interface

Previous articles used ros2 topic echo to inspect numerical data, but questions such as "is the robot in the right place on the map?" or "does the LiDAR point cloud match the real walls?" require visualization. RViz2 is ROS2's official 3D tool for visualizing all types of robot data together.

Key concepts

rviz2

The first step after opening RViz2 is always to choose the Fixed Frame (top left, Global Options panel) — the reference frame relative to which all other data is drawn. Choosing the wrong frame (for example, base_link instead of map or odom) makes the map/trajectory appear to rotate strangely around the robot, even if the original data is entirely correct.

In short: Always check the Fixed Frame before suspecting bad data — most confusing RViz2 displays encountered by beginners come from the wrong Fixed Frame rather than an algorithm bug.

How it works

Add a Display for each data type — the Add button in the Displays panel (left) opens the list of display types:

DisplayShows
LaserScanLiDAR scan data (/scan)
TFThe entire frame tree, visualizing frame-to-frame relationships
MapThe occupancy grid map (/map) from SLAM
RobotModelThe URDF-based 3D robot model, moving according to actual TF data
PathThe planned path (/plan from Nav2)
OdometryThe traveled trajectory, constructed from /odom

A faster alternative to adding by type: the By topic tab lists publishing topics. Select the desired topic directly, and RViz2 infers the appropriate Display type.

Debugging TF in RViz2: adding the TF Display is the fastest way to detect frame configuration errors — a frame floating disconnected from the main TF tree, or two incorrectly overlapping frames, becomes immediately visible. This is much faster than reading raw numbers from ros2 topic echo /tf.

Technical details

Parameters

Beyond the basic Displays above, these advanced types are common in real AMR/SLAM projects:

DisplayShows
PointCloud23D point clouds (3D LiDAR, depth cameras)
MarkerArrayCustom graphics published by your code (danger zones, goals, geometry debugging)
InteractiveMarkersDraggable interactive markers, used in manipulator trajectory editing tools

Practical applications

RViz2's toolbar includes 2D Nav Goal — click a point and direction on the screen to send a NavigateToPose goal (the action covered in ROS2 Communication) to Nav2. This is equivalent to typing ros2 action send_goal, but much more intuitive for quick development tests. That is why RViz2 is almost always open alongside the physical robot during Nav2 development, serving as both a monitor and a test control interface.

Practical example

Save your configuration for reuse — RViz2 can save the entire layout (added Displays, Fixed Frame, camera view) into a .rviz file (File → Save Config As). A robot package's launch file typically opens its own .rviz file automatically:

Node(
    package="rviz2",
    executable="rviz2",
    arguments=["-d", "/path/to/nav2_default_view.rviz"],
)
Result: at every bringup, RViz2 opens with:
- Fixed Frame = "map"
- LaserScan, Map, RobotModel, TF and Path Displays already enabled
- The camera view already aligned with the robot

This avoids manually adding every Display at each bringup — RViz2 opens with the right viewpoint and data layers for monitoring Nav2/SLAM.

Common mistakes

  • A Display shows no data because of QoS incompatibility — as discussed in the QoS article, each RViz2 Display has its own QoS override (expand its Topic section in the left panel). Try changing Reliability to Best Effort if a Display is empty despite a topic definitely carrying data.
  • RobotModel shows nothing — usually /robot_description (containing the URDF) has not been published, or robot_state_publisher is not running. Check ros2 topic echo /robot_description --once before suspecting the Display configuration.
  • RViz2 stutters/lags with many heavy Displays enabled — multiple high-resolution PointCloud2 or large Image Displays can consume considerable graphics resources. Disable unnecessary Displays when focusing on a specific issue.
  • Running RViz2 over SSH without X11 forwarding — RViz2 is graphical and generally requires ssh -X (X11 forwarding) or VNC. Running it over ordinary SSH (without -X) reports an error opening the display window.

Conclusion

RViz2 turns ROS2's raw numerical data into visual information — essential for debugging TF, SLAM and Nav2, while also providing a test control interface through "2D Nav Goal". Always check the Fixed Frame first when data looks wrong. This concludes ROS2 Tools: together with node/topic/service/action/param/bag, you now have a complete debugging toolkit for any ROS2 system. The next category, Advanced ROS2, explores performance optimization and more complex node architectures.

Get new articles and lessons by email

When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.

Unsubscribe any time with the link in each email. See our Privacy policy.

RViz2 — a tool for visualizing robot data — Atlas Robotics