Visualizing and plotting scalar data
ROS already has generic tools to plot scalar data. These tools can also be used for plotting non-scalar data, but each scalar field needs to be plotted separately in order to show less information. Alternately, ROS has powerful visualization tools for non-scalar or vector data, which we will discuss in the next section.
Getting ready
In this section, we will learn that scalar data can be plotted as a time series, where time is provided by the timestamps of the messages. We can use the y axis to plot scalar data versus timestamps along the x axis. ROS has a GUI tool called rqt_plot
, which will do this for us.
To see rqt_plot
in action, we will use the program4
node which publishes scalar and vector data in two different topics, /temperature
and /acceleration
, respectively (refer to program4.cpp
at GitHub for more information). However, the values in the message are synthetically generated and so they do not have physical meaning but are useful in our plotting...