On Wed, Sep 1, 2010 at 9:46 AM, Joel Cartwright <J.J.Cartwright@hw.ac.uk> wrote:
... would you have a problem with out of
order messages with this script (from different publishers), and still
need to sort them somehow?

I'm not sure what "sorting" means here.  Messages are stored in bags with a timestamp.  That timestamp can be anything.  rosbag record subscribes to topics and stores the message receipt time.  No matter how the timestamps are written to the bag, the rosbag API (or rosbag play) will use the bag index to return the messages in chronological order based on the stored timestamp.

This script is changing the stored timestamp to be the Header timestamp.  The order will differ if the publish order is not the same as the Header timestamp order.  That's fine in Armin's use case of visualizing joint states and laser scans.

There the transport hints sets UDP as a preference, and falls back to
TCP with the 'no delay' option set.

If you need reliable transfer, you could just try the tcpNoDelay option
without the UDP hint.

In general, those are good suggestions.  I doubt TCP_NODELAY is the issue here - Armin's publishing laser scans at 10 Hz and seeing delays on the order of seconds.

Tim