[ros-users] [Discourse.ros.org] [Next Generation ROS] Composition and Parameters: Best Practice Suggestions
Poonam1120 via Discourse.ros.org
ros.discourse at gmail.com
Thu Jan 10 12:07:52 UTC 2019
Hi All,
I am also trying to use manual composition and ros2 parameter feature with the demo example only.
I tried both ways.
1) add parameter client to the node itself.
rclcpp::SyncParametersClient::SharedPtr parameters_client = std::make_shared<rclcpp::SyncParametersClient>(this);
With this approch, I get error as no matchin function as "rclcpp::SyncParametersClient::SyncParametersClient". Because this is referrence to talker node which is of type composition.
2)add parameter client before adding to the executor:
auto talker = std::make_shared<composition::Talker>();
auto parameter_client = std::make_shared<rclcpp::parameter_client::SyncParametersClient>(talker);
exec.add_node(talker);
With this approach, not able to set parameters, as parameter_client is define here and set parameter action is getting done in talker_component.cpp.
I am testing this on crystal.
Thanks
---
[Visit Topic](https://discourse.ros.org/t/composition-and-parameters-best-practice-suggestions/1001/13) or reply to this email to respond.
More information about the ros-users
mailing list