add methods for batching delacare parameters.(#1970)
address a part of https://github.com/ros2/rclcpp/issues/1970
Signed-off-by: Lei Liu [email protected]
@fujitatomoya
This PR still in progress, testcases and some feedbacks will be processed.
I don't think this completely solves the parameter event batching issue. Since __declare_parameters_common calls __set_parameters_atomically_common in a loop, even though the parameter events for parameter declaration are batched together, I think there will still be separate events for each time the parameter is set, since __set_parameters_atomically_common sends parameter events each iteration of the loop.
I don't think this completely solves the parameter event batching issue. Since
__declare_parameters_commoncalls__set_parameters_atomically_commonin a loop, even though the parameter events for parameter declaration are batched together, I think there will still be separate events for each time the parameter is set, since__set_parameters_atomically_commonsends parameter events each iteration of the loop.
Thanks for your tips, I will update it later.
@Aposhian
__set_parameters_atomically_common sends parameter events each iteration of the loop.
__set_parameters_atomically_common does not send parameter events, it just fill parameter info per iteration, the publish work will done once at last of set_parameters_atomically.
`
@fujitatomoya
if we change declare_parameters/_atomically return rcl_interfaces::msg::SetParametersResult, but the exist APIs bellow:
template<typename ParameterT>
std::vector<ParameterT>
Node::declare_parameters(
const std::string & namespace_,
const std::map<std::string, ParameterT> & parameters,
bool ignore_overrides)
which return parameter values, and will make them different. I mean that Node::declare_parameters will be refactory to call declare_parameters_atomically, but their return value are different.
@llapx why are we closing this PR?
@fujitatomoya
Sorry, I have reforked rclcpp with rolling branch (the old one does not contain it) for new work. I forgot the PR still associated with the old one.