Save / Dump / Load parameters to / from file using rclcpp
@mjcarroll is already working on this.
Since Nov 20, 2025.
- Dominant language
- C++
- Stars
- 805
- Forks
- 564
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 27
Description
Description
Create a function to save parameters to a file inside a C++ node. Something like `node->save_parameters(path);'. This can be useful when the parameters are changed inside a callback and the user wants to restart the node with those changes applied.
I understand that the launch files provide sufficient features to load the parameters at start. However, it can be useful to load a configuration set, making it easier to change the file loaded than each parameter individually.
It differs from ros2_persist_parameter_server in that it's not centralized. The parameters are still owned by the node, and it's responsible for managing them. A non-centrilized aproach is better for modularity as it's not necessary to add or remove packages from the central entity when changes are made. The ros2 param dump is also not the best option, given the modularity argument. Maintenance in a central entity is something we would like to avoid.
Motivation
I'm working on an autonomous sprayer called Arbus 4000 JAV. We have several parameters, such as spraying configuration and behaviour ones, in the system. We would like to save these parameters in a persistent way so the user can change them at run time and have them already configured on reboot. Also, it's useful to change between preconfigured spraying behaviours for different crops wich consist in load some parameters.
Design / Implementation Considerations
No response
Additional Information
Does it make sense to be part of the rclcpp, or is it better to have a dedicated class for that?
Is there a better way to do that? Are there any other use cases?
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.
Assessment
This issue has not been assessed yet.