Is it possible to write parameter value into a yaml file during runtime
I am developing a node that reads data from a sensor and during initialization I do some calibration to the data. I would like to dump this calibration data into the yaml parameter file so that in the future I can use this data directly without having to caliberate the sensor during every initialization.
Is there a ros2 foxy api to write back parameter values to the yaml file belonging to the package?
Are you looking for the programmatic equivalent of the CLI command
ros2 param dump
? Doesn't look like one is available (though I could be wrong), however on inspecting the source code of the CLI command, it's just Python'syaml.dump()
, so shouldn't be too hard to write one up by yourself