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

Revision history [back]

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 [...]