message-filters

Synchronize ROS 2 topic data streams by timestamp using message_filters.

18|2|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill message-filters
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: message-filters
Source: https://github.com/wimblerobotics/ros2-copilot-skills/tree/main/message-filters
Command: npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill message-filters

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Facilitate time-aligned processing of messages from multiple ROS 2 topics by using message_filters to synchronize callbacks based on timestamps.

Core Features & Use Cases

  • TimeSynchronizer for exact timestamp matching across topics.
  • ApproximateTimeSynchronizer for near-simultaneous messages with slop.
  • Python and C++ usage examples for both subscription patterns, QoS considerations, and cached filtering.
  • Common debugging guidance to ensure reliable data fusion in perception pipelines.

Quick Start

Configure a multi-topic ROS 2 node to subscribe to the relevant topics with message_filters.Subscriber instances, create a TimeSynchronizer or ApproximateTimeSynchronizer, register a callback, and process the synchronized data.

Frequently Asked Questions about message-filters

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I synchronize multi-topic ROS 2 data streams by timestamp?

To synchronize ROS 2 data streams by timestamp, use message_filters to create Subscriber instances for your topics, then register a callback with TimeSynchronizer for exact matches or ApproximateTimeSynchronizer for near-simultaneous messages.

When should I use ApproximateTimeSynchronizer instead of TimeSynchronizer for ROS 2 messages?

Use ApproximateTimeSynchronizer instead of TimeSynchronizer when aligning near-simultaneous ROS 2 messages with slop, which is essential for perception pipelines fusing camera, IMU, lidar, or radar data that lack perfectly matching timestamps.

Can I use message_filters for multi-sensor synchronization in both Python and C++ ROS 2 nodes?

Yes, message_filters supports multi-sensor synchronization in both Python and C++ ROS 2 nodes, providing usage examples for both subscription patterns alongside QoS considerations and cached filtering for reliable data fusion.

Why does my ROS 2 multi-topic synchronization callback fail to trigger during data fusion?

ROS 2 multi-topic synchronization callbacks fail to trigger when timestamp pairing is misaligned or QoS settings mismatch, requiring debugging of message_filters subscriber configurations and QoS profiles to ensure reliable perception pipeline data fusion.

What's the best way to align camera and IMU data in a ROS 2 perception pipeline?

The best way to align camera and IMU data in a ROS 2 perception pipeline is using message_filters to enforce timestamp-based pairing, ensuring synchronized callbacks across sensors using either exact or approximate time matching.