ROS_INFO_STREAM
What does ROS_INFO_STREAM, ROS_INFO, and ROS_ERROR do? Do they output data?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
What does ROS_INFO_STREAM, ROS_INFO, and ROS_ERROR do? Do they output data?
See the rosconsole docs for details on these logging macros. You can view and configure the verbosity for a particular node using rxconsole.
ROS_INFO
macro accepts C-style printf
formatting parameters as in this example from "Mastering ROS'":
ROS_INFO("From Client [%s], Server says [%s]", req.in.c_str(), res.out.c_str())
ROS_INFO_STREAM
macro accepts C++ style std::iostream
formatting as in this example from "A Gentle Introduction to ROS":
ROS_INFO_STREAM("Sending random velocity command: " << " linear=" << msg. linear . x << "angular=" << msg. angular . z)
I dont know if the information has been moved since this question was answered but the given link to rosconsole docs mentions nothing about ROS_INFO and the top search result on google takes you to this page :-( I was able to discern from the description in Learning ROS for Robotics Programming that the difference between ROS_INFO and ROS_INFO_STREAM is that the former is intended for C and the latter for C++. However it seems a bit more complicated than that. I had several ROS_INFO calls in my C++ code that seemed to work fine but in another place ROS_INFO_STREAM worked while ROS_INFO printed nothing. ROS_ERROR is for sending error messages to whatever stream or fd you have set up for errors
the rosconsole docs linked by @Eric Perko list all the logging macros in the Code API section. The examples are just given once, but at the end of the section the other verbosity levels are listed. That includes INFO
.
I agree, and it would seem more clear to give explicit examples, or even something like ROS_VERBOSITY_TYPE
as a base format so it's clear that every time we see ROS_DEBUG_X
, the DEBUG
could be otherwise. As is, the user has to infer this (and beginners likely won't, hence this question).
@pauljurczak The previous comment exactly says why ROS_INFO
can't be found on the page :
every time we see ROS_DEBUG_X, the DEBUG could be otherwise
@Delb It took me a while to understand what you meant. It is certainly beyond any search engine capability. I'm going to edit ROS Wiki to make it more clear to newbies like me.
@gvdhoom That would be too much typing ;-) I just edited that page - have a look.
Asked: 2011-08-04 05:23:58 -0500
Seen: 30,916 times
Last updated: Aug 30 '21
ROS log file change of time-stamping format
rosconsole: log file bloated with ros topics, etc.
ROS_LOG, ROS_DEBUG, ROS_INFO log twice
Is'nt ROS_INFO_STREAM_THROTTLE signature a little misleading
How do I configure log level for a node?
Question about roslaunch and remote processes
ROS_INFO vs ROS_INFO_STREAM [closed]
How to configure ROS_INFO to print a human readable time? [closed]