Logging and visualizing ROS messages
In software development, it is always good practice to include messages that indicate what the program is doing with clarity without compromising the efficiency of the software. The ROS framework provides a set of APIs to enable these features, which is built on top of log4cxx, a log4j logger library.
In short, we have several levels of messages, and all of them have a negligible footprint on performance and can be masked by the current verbosity level during compile time or even in runtime. Moreover, they are fully integrated with other ROS tools for visualization.
Getting ready
ROS has a great number of functions and macros to display log messages which support various verbosity levels, conditions, STL streams, throttling, and other special features. We are going to learn about these in this section.
We will start with a simple information message that prints the messages onto the console:
ROS_INFO( ""ROS INFO message."" );
As a result of running a program...