[ros-users] [Discourse.ros.org] [Next Generation ROS] Composition and Parameters: Best Practice Suggestions

Secretary Birds ros.discourse at gmail.com
Wed Dec 21 22:30:41 UTC 2016

[quote="rohbotics, post:3, topic:1001"]
ParameterService allows other nodes to set/get/list parameters in this node.
[quote="wjwwood, post:2, topic:1001"]
(also I think the node automatically has a parameter service, so you should only need a client)

I initially tried sending params to the talker without adding any code, and it failed. So that puts this statement into question.

Thanks for the insight on the proper usage. 

[quote="rohbotics, post:3, topic:1001"]
Neither of these are the API for interacting with the parameters for this node, which should be done through Node
I guess I never knew this. What is the API for setting/getting params in Node? I hadn't seen anything in the past. Maybe things have changed and I'm just oblivious. :blush:

The way I've been working with parameters is to create a Service and Client for each node. Then I register an event callback for each node. And inside the param event callback for each node, I condition on the name of the parameter being modified/created/deleted, and assign the value to a local variable used for computation, etc.

Sounds like that approach is off-the-mark. I'll look into the `Node::register_param_change_callback()
` method and modify how I'm working with parameters.
Usually my use case is to create/setup my node, wait for parameters to be set to a good value (typically by an external entity), then proceed to do work.

[Visit Topic](https://discourse.ros.org/t/composition-and-parameters-best-practice-suggestions/1001/4) or reply to this email to respond.

More information about the ros-users mailing list