Rosanswers logo

I am a big fan of rosbags. Right now I am doing a series of pretty complex tests on some mobile robots. I like to bag everything for each test, so that I can go back and review what happened to catch bugs. Rqt_bag's visualization capabilities make debugging certain aspects of my system extremely easy. However, I am continually frustrated that Log information produced by calls to ROS_ERROR(), ROS_INFO(), ROS_DEBUG(), etc. does not appear to be stored in my bag files. I can see that rosout has messages publish in it similar to:

  • header
  • level: 8
  • name: /PelicanMMS
  • file: /asctec/PelicanMMS/PelicanROS/src/VTOL...
  • function: startHandler
  • line: 38
  • topics

This can point me to the exact origin of one of my debug calls, but it does not contain the actual text of the call! I know that the text from my log calls can be found in the generated log files, or captured with rqt_console; but, I want the logging text stored in my bag. My questions are:

Is there some system setting or configuration that I could specify to make the text logging information get bagged? If this is impossible, is there a simple work around?

Originally posted by Carter12s on ROS Answers with karma: 218 on 2014-07-18

Post score: 3


2 Answers 2


Rosanswers logo

I suspect you're running into this bug: https://github.com/ros-visualization/rqt_common_plugins/issues/226

In short, your log output is there, but rqt_bag isn't displaying it due to a bug.

A couple of things to try:

  • Upgrade to a newer version of rqt_bag
  • Use rosbag play to play back your log files into rqt_console.

Originally posted by ahendrix with karma: 47576 on 2014-07-19

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by Carter12s on 2014-07-21:
That is it exactly! The bug is with rqt_bag; I can publish from rqt_bag into rqt_console and see the 'msg' field, but rqt_bag does not display it internally. Thank you so much for pointing me in the right direction!


Rosanswers logo

Hmm, this should be possible with the standard tools. The log messages should be on the /rosout topic, which has message type rosgraph_msgs/Log. One of the fields of Log is "msg", which contains the text of the call to ROS_ERROR() and friends. Using roscpp_tutorials/talker as an example:

(in one terminal):

rosrun roscpp_tutorials talker

(in another terminal, simultaneously):

rostopic echo rosout/msg

this will print the text of the calls to the ROS_whatever() macros

to toss these Log messages into a bag with your other topics, just add the "rosout" topic to the list of topics you're passing to "rosbag record":

rosbag record topic1 topic2 rosbag [...]

Originally posted by Morgan with karma: 521 on 2014-07-18

This answer was NOT ACCEPTED on the original site

Post score: 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.