geometry2
geometry2 copied to clipboard
Enable CallbackQueue in tf2_ros::MessageFilter
Feature request
Feature description
- PR #81 ported most of
MessageFilter
to ROS 2, but there was a TODO for @clalancette to "reenable this once we have underlying support for callback queues" (merged November 2018) - https://github.com/ros2/rclcpp/pull/1218 added support for callback groups (merged September 2020)
Implementation considerations
- I don't know if there's any particular reason that this has not been ported yet, or whether it causing the problem I'm seeing at this exact moment, but I figured it should at least be documented.
I would like to pick this up, but currently I don't know if it's possible to do this. Beforehand CallbackQueue
would add it's own callback, now CallbackGroup
is set up at compile time:
the user does not specify any callback group when creating a subscription...
So the CallbackGroup
we set up in the MessageFillter
must be created before the message_filters::Subscriber
or whatever callback object we use. That way we can add the CallbackGroup
as an option, or another part of the constructor of that object creating callbacks. Problamatically we've got a chicken and egg situation where the MessageFilter
constructor takes in that object to call connectInput
.
So, either the user must create their own CallbackGroup
to pair with the F & f
that MessageFilter
takes as a constructor parameter or the user must call connectInput
in some separate function, after calling some function setupSomeCallbackGroup
, which can occur after the constructor is instantiated. But the latter just seems like the former with extra steps.