March 2018
Intermediate to advanced
1396 pages
42h 14m
English
ROS comes with a great number of functions/macros to output logging messages. It supports different levels, conditions, STL streams, throttling, and other features that we will see in this section. To start with something simple, an information message is printed with this code in C++:
$ ROS_INFO("My INFO message.");
In order to have access to these logging functions/macros, the following header is required:
#include <ros/ros.h>
This includes the following header (where the logging API is defined):
#include <ros/console.h>
As a result of running a program with the preceding message, we will get the following output:
[ INFO] [1356440230.837067170]: My INFO message.
All messages are printed with their level ...