4

I am trying to capture the bag files for all the ROS topics using rosbag record -a.

And when I terminate the record using Ctrl+C, the bag file captured is showing in .bag.active status and it looks like no data is being captured as the size of the file is 4.1 kB.

If I give topics individually it runs without any issue capturing the bag file.

Can anybody please help me to fix this issue?

Troubleshooting steps taken: Tried reindexing with rosbag reindex but no luck. Moreover size of the file is 4.1 kB.

Thank you. KK

Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
KK2491
  • 451
  • 1
  • 8
  • 25

1 Answers1

3

4.1 kB is the empty container template, so you actually missing all the topics or it is nothing published over the topics. You have to make sure, that you are connected to the same roscore. Further, before starting rosbag in a terminal, execute the following commands to make sure that some stuff goes over the wire.

  • Use rostopic list to show available topics (if this shows nothing, make sure your nodes are alive and you are connected to the same roscore)
  • Use rostopic hz some/topics/name/you/want/to/record to see if the nodes are sending data frequently

Further, you need to kill rosbag gracefully! See this answer for more information.

Edit:

For further investigation, you should always make sure that everthing is run in a single instance and organized by one launch file:

<launch>
<!-- All your stuff goes here -->
<node pkg="rosbag" type="record" name="my_rosbag" output="screen" args="--all"/>
</launch>
  1. First kill all remaining instances: killall roscore
  2. Run the launchfile: roslaunch /location/to/your/launchfile.launch
Tik0
  • 2,499
  • 4
  • 35
  • 50
  • thanks for the reply. I have tried capturing the topics individually, it works fine without any issue (Collects the bag files). Seems like only rosbag record -a is having issue. – KK2491 Jun 11 '18 at 13:40
  • OK that sounds odd. According to the [manual](http://wiki.ros.org/rosbag/Commandline#record), the `-all` argument induces rosbag to poll the rosmaster for new topics periodically. So either your topics/master doing nasty stuff, or the rosbag is unable to poll in your case. Could you please explain about your scenario and also add the rosbag outputs in both cases where it works and not? – Tik0 Jun 11 '18 at 14:49
  • There is one more thing to be really sure that it is `rosbag` which is faulty: Write down a **single** launch file which comprises your nodes and rosbag (example in the edited answer). If this doesn't work either, you really have to come up with more information! – Tik0 Jun 11 '18 at 22:17
  • Thank you. i will try with "launch" and post the findings. – KK2491 Jun 12 '18 at 02:09
  • Where is "my_rosbag" saved? – Orestis Kapar Apr 15 '20 at 23:15