Ask Your Question
0

does rosbag guarantee data will be published correctly everytime ?

asked 2016-01-21 01:06:05 -0600

dmngu9 gravatar image

updated 2016-01-21 01:06:44 -0600

Assume i have a bag file and run it multiple times. In those times, is the data the same ? ( i mean is there any data lost?)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-01-21 01:15:28 -0600

ahendrix gravatar image

No. rosbag may skip messages during playback to maintain the desired playback speed. If rosbag starts playing messages immediately, the first message or two may be missed by the subscriber, before the topic is set up.

You can use the -d option to have rosbag delay between advertising a topic and starting playback, to give subscribers time to connect.

You can slow down the publish rate with the -r option, and this can help prevent dropped message; this works particularly well when used with the --clock option and the use_sim_time parameter.

Have a look at the rosbag command line page for more interesting options that you can use with rosbag.

edit flag offensive delete link more
1

answered 2016-01-21 01:15:45 -0600

updated 2016-01-21 01:18:53 -0600

As described by @ahendrix, data apparently could be dropped if the desired playback time would otherwise not be reached. Two further potential caveats:

  • There will be some jitter/small differences in the publishing and arrival time of data at subscribers due to system CPU load and other random factors
  • If data is published at very high rates, it might exceed queue sizes, in which case some data could be dropped. This is true for both the publisher (i.e. rosbag play) and subscriber sides. For both, the queue size has to be set appropriately (See queue related params for rosbag (play) and for subscribers.
edit flag offensive delete link more

Comments

i can see the queue size of the rosbag and subscriber node affect the result of my algorithm which is not desirable. Thanks for your help

dmngu9 gravatar imagedmngu9 ( 2016-01-21 17:46:58 -0600 )edit

i have 1 more question. when i filter one topic out of the bag into another bag and run the same nodes to process that topic. Everytime i run the new bag file, it gives me slightly different results . Why that happened?

dmngu9 gravatar imagedmngu9 ( 2016-01-21 19:32:44 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-01-21 01:06:05 -0600

Seen: 619 times

Last updated: Jan 21 '16