I have been able to stop the publisher to the topic (/parameter_events
) by setting start_parameter_event_publisher
in NodeOptions
to false
. Is there a way to stop the subscriber?
1 Answer
A node should not have a default subscriber for /parameter_events
: the programmer of the node chooses to either add that subscription, or not.
However, currently a subscriber is created here.
There's is a 'TODO' remark about this in the code, which references this github issue. I left a remark to reopen that issue.
So as of yet, to disable the subscription, I don't see another option than to change it in the code and compile rclcpp
from source. Removing above mentioned lines effectively ensures that the subscription is no longer made (I tested it). However, based on a quick look at the callback function, I assume that this breaks the use_sim_time
parameter functionality.
-
1$\begingroup$ I think that's basically what I am asking. I am not sure I have found an option in NodeOptions to stop it. (I have disabled parameters in general) $\endgroup$ Nov 13 at 19:17
-
$\begingroup$ If it is about a specific node that you are using, post a reference to that node and I can have a look. Or if you experience that nodes which you wrote subscribe to
/parameter_events
without you explicitly creating such a subscription in that node, post a minimal example, as I don't think that that should happen. $\endgroup$– JRTGNov 13 at 20:07 -
$\begingroup$ The minimal publisher and minimal subscriber example in ROS 2 documentation is what I am working with $\endgroup$ Nov 13 at 23:07
-