A lot of people ask me about the difference between rviz and Gazebo, two popular software tools that are used with ROS. After all, both programs enable you to view a simulated robot in 3D. Let’s take a look at how they’re different.
What is rviz?
rviz (short for “ROS visualization”) is a 3D visualization software tool for robots, sensors, and algorithms. It enables you to see the robot’s perception of its world (real or simulated).
The purpose of rviz is to enable you to visualize the state of a robot. It uses sensor data to try to create an accurate depiction of what is going on in the robot’s environment.
To launch rviz, type the following command in your terminal:
And in a different terminal tab, type:
rosrun rviz rviz
Here is the screen you should see when you launch rviz:
The left panel is the Displays panel. It has a list of plugins. These plugins enable you to view sensor data and robot state information. To add a plugin, you would click the Add button on the bottom left of the window.
What is Gazebo?
Gazebo is a 3D robot simulator. Its objective is to simulate a robot, giving you a close substitute to how your robot would behave in a real-world physical environment. It can compute the impact of forces (such as gravity).
Here is my tutorial on how to launch Gazebo.
So What is the Difference?
The difference between the two can be summed up in the following excerpt from Morgan Quigley (one of the original developers of ROS) in his book Programming Robots with ROS:
“rviz shows you what the robot thinks is happening, while Gazebo shows you what is really happening.”