Share values between nodes

Hi everyone,
I generate a value from a node that needs to be access by other nodes even when the first one finishes its execution or the package is not recompile.
I have tried to use params, but I think that they are only available when the node that set the param is running. I’ve also tried to store this value in a yaml file, but the value is stored in ros2_ws/install/<package_name>/share/<package_name>/config/ instead of in <package_name>/config folder (path where the yaml is stored) so I guess I would lose the value after recompiling.
Can anyone help me with a better approach?
Thanks in advance!

Hello @lfernandez,

one idea that comes to mind is to use a package named “Persistent Parameter Server”, you can find it here:

I have also made a video about it:

Hope this helps,


Thanks @rzegers!!
Can these persistent parameters being got from a python node?
Thanks again

Hi @lfernandez, these are normal ROS2 parameters,so your ROS node can be written in any programming language. What’s different is that they just run on an independent node, so they will be accesible even if your node finished executing, and they are saved to disk, so next time you start this persistent parameter server you will have the latest values.

1 Like

Perfect @rzegers zegers! I think this will work.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.