Currently a node lives in a executor, and callbacks from timers and subscriptions are executed by that executor, taking callbackgroups into account.
However, sometimes I have a trigger from somewhere else, not related to ROS, that I want to handle in that same context, This to prevent having to fiddle with mutexes etc.
Basically something like this:
rclcpp::Node::execute(CallbackT && callback, rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr);
I then expect the callback to be executed as soon as possible in the same way as a subscription or timer callback.
Now I do it by creating a one-off timer with a duration of 0, but it’s not the nicest thing in the word. Would it be useful to have something like that in ros2?