ROS2 parameter sync and async
Hi Everyone,
I am tryin demo examples of ROS2 paramter,(sync and async both) but not with single node, creating two nodes, one for set param and other for get param.
But I am confused with the difference between sync and async. Should we pass remote node name(set param node name) with async type or not? If I don't pass the remote node name, I don't get the parameters. What is the correct way and what is the exact diff between sync and sync param client? It is not very clear from the demo examples.
With sync, on get param node,
auto parameters_client = std::make_shared<rclcpp::SyncParametersClient>(node, "set param node name");
With Async, on get param node,
auto parameters_client = std::make_shared<rclcpp::AsyncParametersClient>(node, "set param node name");
Here, I am doing one extra thing, rclcpp::spin_until_future_complete(node, parameters).
I referred this link https://answers.ros.org/question/3060...
Thanks.