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

Why don't Log outputs end up in Bags? Can I force them to?

asked 2014-07-18 09:23:45 -0500

Carter12s gravatar image

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?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-07-19 19:52:54 -0500

ahendrix gravatar image

updated 2014-07-19 19:58:44 -0500

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

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.
edit flag offensive delete link more

Comments

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!

Carter12s gravatar image Carter12s  ( 2014-07-21 08:10:42 -0500 )edit
2

answered 2014-07-18 15:27:27 -0500

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 [...]
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-07-18 09:23:45 -0500

Seen: 1,154 times

Last updated: Jul 19 '14