0
$\begingroup$

Rosanswers logo

hello everyone
I built two bag files: the first one contains 4000 messages, the second one only one message (it's just needed to advice my program that the first bag file has finished playing).
This is what I get by applying rosbag info to first bag

ubisum@ubisum:~/fuerte_workspace/beginner/bags$ rosbag info subset.bag
path:        subset.bag
version:     2.0
duration:    3:45s (225s)
start:       Jan 01 1970 01:36:56.10 (2216.10)
end:         Jan 01 1970 01:40:41.30 (2441.30)
size:        20.5 MB
messages:    4507
compression: none [28/28 chunks]
types:       nav_msgs/Odometry     [cd5e73d190d741a2f92e81eda573aca7]
             sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369]
topics:      /base_scan   2254 msgs    : sensor_msgs/LaserScan
             /odom        2253 msgs    : nav_msgs/Odometry

and to the other one:

ubisum@ubisum:~/fuerte_workspace/beginner/bags$ rosbag info end.bag
path:        end.bag
version:     2.0
duration:    0.0s
start:       Dec 19 2012 15:15:20.78 (1355926520.78)
end:         Dec 19 2012 15:15:20.78 (1355926520.78)
size:        4.7 KB
messages:    1
compression: none [1/1 chunks]
types:       std_msgs/String [992ce8a1687cec8c8bd883ec73ca41d1]
topics:      /end   1 msg     : std_msgs/String

When they are played separately, I can see on shell only one row, telling me how many seconds are left before ending of playing and the total duration is exactly the one reported by rosbag info.
When I play two bags in sequence by

rosbag play subset.bag end.bag

during playing of first bag I get the following:

  
  
   [RUNNING]  Bag Time:   2376.300271   Duration: 160.200271 / 1355924304.678373  
   [RUNNING]  Bag Time:   2376.400248   Duration: 160.300248 / 1355924304.678373  
   [RUNNING]  Bag Time:   2376.500284   Duration: 160.400284 / 1355924304.678373  
   [RUNNING]  Bag Time:   2376.600396   Duration: 160.500396 / 1355924304.678373  
   [RUNNING]  Bag Time:   2376.701079   Duration: 160.601079 / 1355924304.678373  
   [RUNNING]  Bag Time:   2376.800272   Duration: 160.700272 / 1355924304.678373  
   [RUNNING]  Bag Time:   2376.901247   Duration: 160.801247 / 1355924304.678373  
   [RUNNING]  Bag Time:   2377.000184   Duration: 160.900184 / 1355924304.678373  
   [RUNNING]  Bag Time:   2377.100197   Duration: 161.000197 / 1355924304.678373  
   [RUNNING]  Bag Time:   2377.200328   Duration: 161.100328 / 1355924304.678373  
   [RUNNING]  Bag Time:   2377.301192   Duration: 161.201192 / 1355924304.678373  
   [RUNNING]  Bag Time:   2377.400301   Duration: 161.300301 / 1355924304.678373  
  

Anyway, these lines continue to appear on the screen and playing never ends: it goes beyond expected duration and I have to stop it by Ctrl+C.
Do you know the reason?

Thanks for support.


Originally posted by ubisum on ROS Answers with karma: 23 on 2012-12-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The timestamps on your two bag files are 42 years apart. It will take that long to get from the first set of messages to the second.


Originally posted by joq with karma: 25443 on 2012-12-23

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by ubisum on 2012-12-23:
nice, do I need a Delorean? :)
apart from jokes, timestamp was determined after registration of messages in the bag. How could/should I modify timestamp of bag file to make sequential playing effective?
thanks

Comment by joq on 2012-12-23:
The simplest thing at this point is probably to write the second file with a zero timestamp (Jan 1, 1970).

Comment by ubisum on 2012-12-23:
how can I perform this modification?

$\endgroup$

Your Answer

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