0
$\begingroup$

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?

$\endgroup$

1 Answer 1

0
$\begingroup$

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.

$\endgroup$
4
  • 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$
    – user37234
    Commented Nov 13, 2023 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$
    – JRTG
    Commented Nov 13, 2023 at 20:07
  • $\begingroup$ The minimal publisher and minimal subscriber example in ROS 2 documentation is what I am working with $\endgroup$
    – user37234
    Commented Nov 13, 2023 at 23:07
  • $\begingroup$ You are correct, I changed my answer. $\endgroup$
    – JRTG
    Commented Nov 14, 2023 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.