Svashasan Logo
Simulated data

Robotics and Middleware · Data processing

Message Synchronisation

Also known as message synchronization, message_filters, ApproximateTime, ExactTime, TimeSynchronizer

IntermediateSource-checked · awaiting technical reviewLast reviewed 6 December 2026

Matching messages from several data streams, such as camera images, LiDAR scans and radar detections, that belong to the same moment, using their timestamps, so they can be processed together.

Explanation

Sensors run at different rates and their messages arrive with different delays, so taking the latest message from each topic rarely represents a single instant. Synchronisation groups messages by their header timestamps, which should reflect acquisition time. In ROS 2 the message_filters package provides this as filters that can be chained together.

Its policy-based Synchronizer supports three policies. ExactTime requires identical timestamps, which suits hardware-triggered sensors. ApproximateEpsilonTime accepts timestamps that match within an epsilon tolerance. ApproximateTime uses an adaptive algorithm to find the best-matching set across channels. The C++ implementation can synchronise up to nine channels. A TimeSequencer can also release messages in timestamp order after a fixed delay, and a Cache keeps recent messages for queries over time intervals.

Synchronisation is only as good as the timestamps. Unsynchronised sensor clocks, arrival-time stamps or variable latency introduce errors that matching cannot remove, which is why vehicles use clock synchronisation (for example IEEE 802.1AS) and hardware triggering. Waiting for matches also adds latency, and dropped messages reduce the output rate.

How it works

Each input stream feeds a queue. When a new message arrives, the policy searches the queues for a combination that satisfies its timing rule: identical stamps, stamps within epsilon, or the adaptive approximate match. When a set is found, the synchroniser invokes a single callback with all matched messages and discards older candidates. Queue sizes bound memory use and waiting time.

Automotive applications

  • Camera–LiDAR fusion and projection
  • Stereo camera pairing
  • Combining radar and camera detections for tracking
  • Aligning ground truth with sensor data for evaluation

Example

A fusion node subscribes to /camera/image at 30 Hz and /lidar/points at 10 Hz through an ApproximateTime synchroniser with queue size 10. Each LiDAR scan is paired with the best-matching camera image by timestamp, and the node projects the points onto that image.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. message_filters documentation (doc/index.rst) (opens in a new tab)

    ROS 2 message_filters project (GitHub) · Project documentation · 3. Time Synchronizer; 6. PolicyBased Synchronizers · retrieved 6 December 2026

    “The Synchronizer filter is templated on a policy that determines how to synchronize the channels.”

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.