dawonn / vectornav

ROS Interface for the VectorNav IMU/GPS
147 stars 179 forks source link

Set all message timestamps to the same value #131

Closed KarlLaczko closed 1 year ago

KarlLaczko commented 1 year ago

This PR fixes a problem I ran into when trying to use message_filters::TimeSynchronizer to synchronise multiple vectornav topics in client code. https://github.com/ros2/message_filters/blob/humble/include/message_filters/time_synchronizer.h

The synchroniser requires all timestamps to be the same across the messages. However, the current vectornav implementation calculates a different timestamp for each message type (CommonGroup, TimeGroup, etc).

This change calculates the timestamp once and uses it for all message types.

This has been tested with our VN-300 and Humble and allows synchronisation using message_filters::TimeSynchronizer.

dawonn commented 1 year ago

Great idea, thanks for the PR.