Ask Your Question
0

ROS_INFO_STREAM

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

qdocehf gravatar image

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

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
4

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

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

Comments

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

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

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

Comments

2

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 imagegvdhoorn ( 2016-08-24 01:57:54 -0600 )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 imagejwhendy ( 2017-05-10 12:36:12 -0600 )edit

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

pauljurczak gravatar imagepauljurczak ( 2019-11-10 22:13:46 -0600 )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 imageDelb ( 2019-11-12 04:28:37 -0600 )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 imagepauljurczak ( 2019-11-12 19:53:44 -0600 )edit

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

gvdhoorn gravatar imagegvdhoorn ( 2019-11-13 01:11:42 -0600 )edit

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

pauljurczak gravatar imagepauljurczak ( 2019-11-13 03:23:55 -0600 )edit

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

gvdhoorn gravatar imagegvdhoorn ( 2019-11-13 04:26:08 -0600 )edit
0

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

pauljurczak gravatar image

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

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)

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 16,555 times

Last updated: Nov 12 '19