Multiple parameters callbacks

asked 2022-05-02 10:20:59 -0500

Boufont gravatar image

Hello,

In my project I have multiple parameters to handle, and trying to find the best way to do so. In ROS1 there was a way to change the namespace of the node, and to assign a callback to each namespace. In ROS2 I tried to do the same:

auto subNode = nodeHandle->create_sub_node("sub_namespace");
subNode->declare_parameter("sub_param");

subNode->add_on_set_parameters_callback(
     (std::bind(&Class::ParametersCallback, this, std::placehoders::_1));

However when I try to set a parameter, all the other parent and sub callbacks are also being called. Is there a way to split the parameters callback functionality?

Thank you

edit retag flag offensive close merge delete