Reputation: 508
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
Upvotes: 4
Views: 5833
Reputation: 2699
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.
rostopic list
to show available topics (if this shows nothing, make sure your nodes are alive and you are connected to the same roscore)rostopic hz some/topics/name/you/want/to/record
to see if the nodes are sending data frequentlyFurther, 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>
killall roscore
roslaunch /location/to/your/launchfile.launch
Upvotes: 3