add_on_set_parameters_callback callback takes vector of parameters but only returns a single SetParametersResult
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 805
- Forks
- 564
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 27
Description
SetParameters
# A list of parameters to set.
Parameter[] parameters
---
# Indicates whether setting each parameter succeeded or not and why.
SetParametersResult[] results
SetParametersResult
# A true value of the same index indicates that the parameter was set
# successfully. A false value indicates the change was rejected.
bool successful
# Reason why the setting was either successful or a failure. This should only be
# used for logging and user interfaces.
string reason
This is probably already a known issue. It seems like there is a mismatch between this interface and the message/service interface in the rcl_interfaces repo. In my testing on foxy it seems that when you send it a vector of parameters to set it calls the callback once for each one (each time with the vector containing only one parameter).
Because this is an interface issue it'll probably have to be fixed over major releases to avoid breaking the most code. What I think should change is the callback interface should return a vector of SetParametsResult to match the service interface.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the callback declaration at rclcpp/include/rclcpp/node_interfaces/node_parameters_interface.hpp#L40-L46 and compare it with the SetParameters service and SetParametersResult definitions in rcl_interfaces. Trace how a vector of parameters is passed on Foxy, then determine the compatibility and release implications; done means the callback and service semantics are consistently specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100