Ask Your Question


asked 2011-08-04 05:23:58 -0500

qdocehf gravatar image

updated 2011-08-04 05:36:41 -0500

What does ROS_INFO_STREAM, ROS_INFO, and ROS_ERROR do? Do they output data?

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted

answered 2011-08-04 05:42:50 -0500

Eric Perko gravatar image

See the rosconsole docs for details on these logging macros. You can view and configure the verbosity for a particular node using rxconsole.

edit flag offensive delete link more


Thanks. For some reason I couldn't find anything about them through google or the ROS search.
qdocehf gravatar image qdocehf  ( 2011-08-04 05:47:23 -0500 )edit

answered 2019-11-10 23:00:10 -0500

pauljurczak gravatar image

updated 2019-11-12 01:13:38 -0500

ROS_INFO macro accepts C-style printf formatting parameters as in this example from "Mastering ROS'":

ROS_INFO("From Client [%s], Server says [%s]",, 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)

edit flag offensive delete link more

answered 2016-08-23 16:55:24 -0500

sunking gravatar image

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

edit flag offensive delete link more



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.

gvdhoorn gravatar image gvdhoorn  ( 2016-08-24 01:57:54 -0500 )edit

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).

jwhendy gravatar image jwhendy  ( 2017-05-10 12:36:12 -0500 )edit

@gvdhoom There is no match for ROS_INFO on that page.

pauljurczak gravatar image pauljurczak  ( 2019-11-10 22:13:46 -0500 )edit

@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 gravatar image Delb  ( 2019-11-12 04:28:37 -0500 )edit

@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.

pauljurczak gravatar image pauljurczak  ( 2019-11-12 19:53:44 -0500 )edit

+1 to clarifying, but please do not add copies of everything for every vebosity type.

gvdhoorn gravatar image gvdhoorn  ( 2019-11-13 01:11:42 -0500 )edit

@gvdhoom That would be too much typing ;-) I just edited that page - have a look.

pauljurczak gravatar image pauljurczak  ( 2019-11-13 03:23:55 -0500 )edit

I've added some edits myself (diff). +1 for making the effort.

gvdhoorn gravatar image gvdhoorn  ( 2019-11-13 04:26:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-08-04 05:23:58 -0500

Seen: 21,914 times

Last updated: Nov 12 '19