Is it possible to write parameter value into a yaml file during runtime

asked 2022-05-14 11:35:40 -0600

asobhy gravatar image

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?

edit retag flag offensive close merge delete

Comments

1

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's yaml.dump(), so shouldn't be too hard to write one up by yourself

abhishek47 gravatar image abhishek47  ( 2022-05-15 08:25:22 -0600 )edit