ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

subscribing to rosout INFO

asked 2012-05-07 19:41:35 -0600

Carlitos gravatar image

updated 2016-01-08 03:29:22 -0600

130s gravatar image

Hi,

I'm sure this is a noob question but I looked in the wiki and in here for a long time and I could not find the answer.

Is there any way of creating a node that will subscribe to the INFO level rosout logs? Basically, I would like to do a Python node that will react to an INFO message being sent to rosout.

Thanks in advance!

edit retag flag offensive close merge delete

Comments

Thanks Lorenz, I tried subscribing to rosout_agg before but I cannot get anything out of it. The messages that I want to read are there (I confirmed with rostopic echo rosout_agg) but my subscriber doesn't work. Is there something wrong with this: rospy.Subscriber("rosout_agg", String, callback)?

Carlitos gravatar image Carlitos  ( 2012-05-12 16:05:18 -0600 )edit

Yes. The type String is wrong. rosout's topic type is rosgraph_msgs/Log.

Lorenz gravatar image Lorenz  ( 2012-05-15 21:44:24 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
5

answered 2012-05-08 00:17:33 -0600

Lorenz gravatar image

updated 2020-03-26 12:47:34 -0600

130s gravatar image

Nodes send log messages on the topic /rosout. These messages are then received by the rosout node and republished on /rosout_agg. You can subscribe one of these topics, /rosout_agg should be preferred though because subscribing to /rosout might lead to many socket connections to all the nodes running on your system. Have a look at the message type of /rosout_agg, which is rosgraph_msgs/Log (UPDATE 20200326 by @130s for clarity). It should contain all the information you need, i.e. the log level and the message.

Please note that info log messages are only published if the logger level of the node that is sending the log message is set to Info or Debug.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-05-07 19:41:35 -0600

Seen: 3,482 times

Last updated: Mar 26 '20