Book Image

Learning ROS for Robotics Programming Second Edition

Book Image

Learning ROS for Robotics Programming Second Edition

Overview of this book

Table of Contents (27 chapters)
Learning ROS for Robotics Programming Second Edition
Credits
About the Author
Acknowledgments
About the Author
Acknowledgments
About the Author
Acknowledgments
About the Author
Acknowledgments
About the Reviewer
About the Reviewer
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Plotting scalar data


Scalar data can be easily plotted with generic tools already available in ROS. Even nonscalar data can be plotted, but with each scalar field plotted separately. That is why we talk about scalar data, because most nonscalar structures are better represented with ad hoc visualizers, some of which we will see later; for instance, images, poses, orientation/attitude, and so on.

Creating a time series plot with rqt_plot

Scalar data can be plotted as a time series over the time provided by the timestamps of the messages. Then, in the y axis, we will plot our scalar data. The tool to do so is rqt_plot. It has a powerful argument syntax, which allows specifying several fields of a structured message in a concise manner as well; we can also add or remove topics or fields manually from the GUI.

To show rqt_plot in action, we are going to use the example4 node since it publishes a scalar and a vector (nonscalar) in two different topics, which are temp and accel, respectively. The...