ROS_INFO vs printf?
Hi there, I was wondering what the differences were between ROS_INFO and printf. In the tutorials it is referred as the equivalent to printf/cout. Any reason why it had to be implemented?
Cheers,
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hi there, I was wondering what the differences were between ROS_INFO and printf. In the tutorials it is referred as the equivalent to printf/cout. Any reason why it had to be implemented?
Cheers,
ROS_INFO's syntax is the same as printf, but ROS_INFO is not printf. The advantage of the ROS logging system is that it provided a wide variety of useful features that printf does not.
For example, ROS_INFO is automatically timestamped for you. Second, it contains five logging levels that you can use. The advantage of these levels is that you can determine how much information you want to see at any given time. You can display only INFO-FATAL messages, or if you're debugging a problem, you can set the level to DEBUG and see all relevant debug messages.
ROS also automatically logs all messages that use ROS_INFO (and all other logging levels) to log files on the filesystem for you so that you can go back and analyze a test later.
EDIT:
See the wiki page here.
@jlohttp://wiki.ros.org/ROS/Tutorials/Usi... rqt_logger_level will let us see/monitoring events on the node and we can set with different logging levels
http://wiki.ros.org/rosconsole here is rosconsole doccumentation.
Another important difference is that ROS_INFO (and ROS_ERR,ROS_WARN, etc..)work as a distributed logging system. Messages are not just shown in the terminal but they are sent over the network to the rosout node. Then the rosout process can unify all the distributed logging messages for many purposes: filter data, using a unified GUI like rxconsole, etc.
As you said that messages are not shown in the terminal..But in general programming we use printf statements to see whether our code works properly or not.. I want to view the lines written inside ROS_INFO in the terminal, is there any procedure for it? Or how to view it through rosout?
Asked: 2012-02-01 00:24:39 -0600
Seen: 35,183 times
Last updated: Feb 01 '12
Is there any console output similar with ROS_INFO without "\n"?
ROS_INFO / ROS_ERROR prints twice on screen [closed]
Is there a way to get ROS_INFO, ROS_ERROR, etc to output line numbers?
remove info and time from ROS_INFO
How to process geometry messages of type PoseWithCovarianceStamped and PoseStampe