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?
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 thecreate_subscription
method and saw that it requires a callback method so I'm wondering if I have to use something else instead of thecreate_subscription
method?