Software
fkie_message_filters
By Fraunhofer FKIE, Germany (checked on github.com/fkie (opens in a new tab)), from github.com/fkie/message_filters (opens in a new tab)
- Middleware
- Library
- Apache-2.0
A C++17 library, a replacement for ROS message_filters, that chains typed data sources and sinks into processing pipelines with filters for ROS topics.
Facts
- GitHub stars
- 30read on 28 Nov 2026
- Last update
- 26 Nov 2026Newest commit on ros2
- Maintenance
- Activea commit in the last 90 days
- Difficulty
- Intermediate
Checked on GitHub on 28 Nov 2026.
Licenses
- Code
- Apache-2.0 (opens in a new tab)
Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit c945a8d (opens in a new tab), on 28 Nov 2026.
- Commercial use
- Yes
At a glance
- What it is
- Models data flow as a pipeline where filters act as both source and sink, possibly with different data types.
- Provides subscribers and publishers that connect pipelines to ROS topics, including camera and image variants.
- Offers combiners that merge multiple sources using FIFO, exact time, or approximate time matching.
- Includes a TF filter that waits for transforms before passing messages on.
- Uses strong typing so incompatible filters fail to compile, and supports arbitrary arities of grouped data.
- Is thread-safe, detects pipeline cycles, and accepts noncopyable movable types such as std::unique_ptr from version 2.0.
Robotheca's summary of the project's documents, not the creator's words.
- Robots on Robotheca
- No robot on Robotheca uses it yet.
- Licence
- Apache-2.0. Commercial use: Yes. Where it was read
- Install
- In the creator's words: The project's website (opens in a new tab)
- Maintenance
- Active, last commit on 26 Nov 2026.
Use it
How to install it, in the creator's words: The project's website (opens in a new tab)
Robotheca doesn't review code. Read it before running it.
Files and versions
- Repository on GitHubgithub.com/fkie/message_filters (opens in a new tab)
- The version Robotheca readc945a8d (opens in a new tab)
- Latest releaseNone published on GitHub
Robotheca read the repository at two versions: the summary at 02b5f12 and the facts and the README at c945a8d (read on 28 Nov 2026).
Robotheca never hosts the code: each link goes to the creator's own page.
The README
The creator's own README, copied as written: README.md by Fraunhofer FKIE, at commit c945a8d, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).
Read the README here
FKIE Message Filters
Summary
The fkie_message_filters library is a replacement for the ROS
message_filters package. It is written in modern C++ and more type-safe than
the original version.
The data flow is modeled with a pipeline metaphor, where data always flows from a source to a sink. A filter is both source and sink for data, possibly with different data types. For integration with ROS, the library provides a number of subscribers and publishers which act as sources or sinks of the data flow.
Requirements
The fkie_message_filters library requires C++17 or newer. Some filters depend
on image_transport or tf2_ros.
Design
The filters are written to be as data agnostic as possible. Therefore, many filters can process arbitrary data types and are not restricted to ROS messages. A few filters need access to ROS header information, such as time stamp or TF frame identifier.
Sources and sinks are strongly typed, i.e., each source will only pass on data of a particular type, and each sink will only accept data of a particular type. The compiler will error out if you try to connect incompatible filters. As the strong typing relies on the C++ template mechanism, the error messages can be quite verbose and difficult to parse sometimes (looking at you, GCC).
The library filters support arbitrary arities, i.e., the grouping of multiple
data types, where items of different types are combined and passed on as a unit.
This is particularly useful to process messages from distinct topics which
belong together conceptually, e.g., the sensor_msgs::msg::Image and
sensor_msgs::msg::CameraInfo messages from a calibrated camera.
Getting Started
While you are free to derive your own filters from the basic source and sink classes, it is most likely better to integrate the application logic with custom callback functions.
The SimpleUserFilter (opens in a new tab) works almost like a regular ROS callback, but it expects a boolean return value that determines if the data is passed on to subsequent filters in the pipeline (if any), or if processing terminates. You can use this type of filter to consume data at the end of the pipeline, or if you want to remove invalid inputs before further processing occurs.
The UserFilter (opens in a new tab) is more generic and can be used if your filter outputs differ from its inputs. You can implement pretty much any kind of transforming filter.
The UserSource (opens in a new tab) is a simple data source which behaves like a function wrapper and can be used as callback in third-party code.
As a simple "Hello World" example, consider:
#include <fkie_message_filters/fkie_message_filters.h>
#include <rclcpp/rclcpp.hpp>
#include <std_msgs/msg/string.hpp>
namespace mf = fkie_message_filters;
using StringSubscriber = mf::Subscriber<std_msgs::msg::String, mf::RosMessage>;
using StringPublisher = mf::Publisher<std_msgs::msg::String, mf::RosMessage>;
using GreetingFilter = mf::UserFilter<StringSubscriber::Output, StringPublisher::Input>;
int main(int argc, char** argv)
{
rclcpp::init(argc, argv);
rclcpp::Node::SharedPtr node = std::make_shared<rclcpp::Node>("hello");
StringSubscriber sub(node, "name");
StringPublisher pub(node, "greeting");
GreetingFilter flt;
flt.set_processing_function(
[](const std_msgs::msg::String& input, const GreetingFilter::CallbackFunction& output)
{
std_msgs::msg::String greeting;
greeting.data = "Hello, " + input.data + "!";
output(greeting);
});
mf::chain(sub, flt, pub);
rclcpp::spin(node);
return 0;
}
The user-defined filter accepts a std_msgs::msg::String message with a name as
input and composes a new std_msgs::msg::String message with a personalized
greeting as output. Note that each source can have arbitrarily many sinks
connected to it, and vice versa, so the simplicity of the three-link chain in
this example is by no means a limitation of the library.
Available Filters
See the API documentation (opens in a new tab) for more details.
Buffer: Store and forward dataCameraPublisher: Publish consumed data to a ROS camera topicsCameraSubscriber: Subscribe to ROS camera topics as data providerCombiner: Combine multiple sources into a single one, using one of the following policies:Fifo: First-In-First-OutExactTime: Exactly matching time stampApproximateTime: Approximately matching time stamp
Divider: Split N-ary sources into N unary onesImagePublisher: Publish consumed data to a ROS image topicImageSubscriber: Subscribe to a ROS image topic as data providerPublisher: Publish consumed data on a ROS topicSelector: Reorder or reduce an N-ary filterSequencer: Enforce correct temporal orderSimpleUserFilter: Simplified filter with user-defined callback functionSubscriber: Subscribe to a ROS topic as data providerTfFilter: Wait for TF transformations for incoming messagesUserFilter: Generic filter with user-defined callback functionUserSource: Manually operated data source
Implementation Details
The pipeline processing is executed by nested calls to receive and send
functions. The library is thread-safe and guarantees basic exception safety,
but you are expected to handle your own exceptions in your callbacks. Exceptions
which propagate through library code will abort processing for the offending
message immediately, even if not all downstream sinks have received the message
yet. If there is no upstream user-defined filter that catches the exception, the
uncaught exception will eventually terminate the program. The library will
detect cycles in the pipeline and abort with a std::logic_error exception.
The Buffer filter can interoperate with ROS callback groups for convenient
workload scheduling.
Starting with version 2.0, the library supports std::unique_ptr and other
noncopyable but movable types. Sources which use these types can only have
a single sink connected for obvious reasons, though.
Quality Declaration
See QUALITY.md (opens in a new tab) in the package source directory.
Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.