intel / ros2_message_filters

22 stars 19 forks source link

How to use message filters in a class with Subscribers as member variables #11

Closed AndreasAZiegler closed 5 years ago

AndreasAZiegler commented 5 years ago

I try to get a time_synchronizer running with an Odometry and a LaserScan topic. The example provided in the README uses subscribers as normal function variables whereas in my case the subscriber are a class member variable.

In the following example (https://github.com/ros2/examples/blob/master/rclcpp/minimal_subscriber/member_function.cpp) the create_subscription method is used to initialize the subscriber class member variable. My question now is, how can I initialize a time_synchronizer? I assume I don't need the callbacks for the Odometry and the LaserScan topic but rather one callback for the synchronizer. I looked into the create_subscription method and saw that it requires a callback method so I'm wondering if I have to use something else instead of the create_subscription method?

hipforth commented 2 years ago

Hello, I have the same problem, how did you solve it? thanks much!