rclcpp icon indicating copy to clipboard operation
rclcpp copied to clipboard

add methods for batching delacare parameters.(#1970)

Open llapx opened this issue 3 years ago • 5 comments

address a part of https://github.com/ros2/rclcpp/issues/1970

Signed-off-by: Lei Liu [email protected]

llapx avatar Aug 17 '22 02:08 llapx

@fujitatomoya

This PR still in progress, testcases and some feedbacks will be processed.

llapx avatar Aug 23 '22 02:08 llapx

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.

Aposhian avatar Aug 23 '22 19:08 Aposhian

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.

Thanks for your tips, I will update it later.

llapx avatar Aug 24 '22 01:08 llapx

@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.

`

llapx avatar Aug 25 '22 07:08 llapx

@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 avatar Aug 26 '22 08:08 llapx

@llapx why are we closing this PR?

fujitatomoya avatar Dec 15 '22 18:12 fujitatomoya

@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.

llapx avatar Dec 16 '22 02:12 llapx