Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Welcome @MatRad.

The main problem I see here is with what you want to synchronize your rosbag clock. The rosbag already contains the clock topic if you saved it during the record. If you want to synchronize somehow the rosbag clock with the system (roscore) clock you will need the paramater use_sim_time and set it to true. This is used to have common time when using data from a rosbag with a node running in your system, in order the processing to not have time problems.

There is a nice explanation of what this variable is used for here.

On the other hand, if you want to synchronize your rosbag topics (that I assume contain a header with the time), you should use message_filters that will filter every message with its corresponding time. However bear in mind this; message_filters only work if you topics contain a header since they need the timestamp on those headers. This internally have nothing to do with the /clock topic since the message filter is based on header time not system time.

Hope that solve your problem.