Visualization in ROS

In robotics, being able to visualize data / commands / motion is an invaluable debugging tool.

ROS provides us multiple tools for visualizing different types data. We have already seen one such visualization tool in the previous class activity - rqt_graph. As a recap, rqt_graph is a visualization tool that helps you visualize ROS nodes (publishers and subscribers) as a connected graph.

In this activity we are going to take a look at rqt_plot and rviz which are useful in plotting / visualizing commands and the resulting motion from those commands.

<aside> ✔️ Prerequisites: ROS Basics

</aside>

<aside> 💡 Before going ahead, make sure that the ros master (roscore) is running.

</aside>

Setup

  1. Download the activity_3.zip from here.
  2. Extract the contents of zip to ~/catkin_ws/src .
  3. Open a new terminal and navigate to your catkin workspace. Then, use catkin build to build the package.
  4. Source your workspace using source ~/catkin_ws/devel/setup.bash.
  5. Launch the simulator using the command roslaunch audubon-gazebo testing_ground.launch . For now, minimize all the windows that this opens.
  6. Open a new terminal and launch the activity package using the command roslaunch activity_3 activity_3.launch.
  7. Do NOT close these terminals or you kill the processes.

rqt_plot

rqt_plot provides a GUI plugin visualizing numeric values in a 2D plot. It is especially useful to visualize scalar quantities such speed, forward acceleration, error, etc.

To get started, open a new terminal window and type rqt_plot and press enter (Do not close this terminal or you will close the application).

This will open up a blank plot similar to the image below:

Untitled

To visualize some data we need to know name of the topic that we want to visualize and the structure of the message that is being published on that topic (Typically, you will always know the name of the topic that you wish to visualize. If not, you can use rosnode info or rqt_graph to find out).