Real-Time Plotting

Plotting data is crucial for analyzing (and debugging…) your setup. A very simple tool is rqt_plot. However, rqt_plot is excrutiatingly annoying to use. Downsides are: you can only plot data over time and it’s very hard to configure, not ideal at all!

Therefore, we highly recommend you use plotjuggler.

To install plotjuggler, run

$ sudo apt install ros-$ROS_DISTRO-plotjuggler-ros

Now, we can start plotjuggler

$ ros2 run plotjuggler plotjuggler

Getting Data In There

../_images/plotjuggler_start.png
  1. Make sure the ROS2 topic subscriber is selected

  2. Choose an appropriate buffer length (seconds). Only data received during this timespan is plotted. Usually something between 30s and 60s. Set it to whatever you need.

  3. Click Start

../_images/plotjuggler_topic_selection.png
  1. We need to select the topics we actually want to subscribe to. Subscribing everything might cause massive network traffic and CPU load.

  2. Confirm

../_images/plotjuggler_time_series_list.png
  1. A list with our selected topics appears (if they are actually published).

  2. If we have many topics, we might want to filter the list to find the data fields we want to plot.

Plotting is done by simply dragging the desired data field and dropping it on the plot area.

We did it! 🥳

Adding Splits

Extremely useful feature!

Parametric Plots

We can do parametric plots (i.e. x-y-plots instead of the x-axis being the time) by using the right mouse button instead of the left one when dragging the selected data fields onto the plot.

Multiple Tabs

../_images/plotjuggler_tabs.png

Saving and Loading the Layout

We do not want to do all the configuration stuff over and over again if we have configured a neat plotting setup, do we?

../_images/plotjuggler_layout.png

Plotting Bag File Data

Instead of streaming live data, we can also plot data stored in a bag file (see Bag File Plotting). Really helpful to see what we actually have recorded (this sometimes differs from what we intended to record).

../_images/plotjuggler_bagfile.png

Scaling

There are only rare cases for which auto scaling the y axis is a good idea. So we better make sure we set some reasonable scaling ourselves.

../_images/plotjuggler_edit_curves.png
  1. Open the context menu with the right mouse button on the plot we want to configure and edit the curves.

../_images/plotjuggler_scaling.png
  1. Choose appropriate minimum and maximum values.

  2. Confirm.

Removing Lines

The same menu as before:

../_images/plotjuggler_remove.png