0
$\begingroup$

Rosanswers logo

Is it possible to load a parameter yaml file during runtime?

I have multiple parameter files that I would like to switch parameter file while running.

For example, I have

  • setting1.yaml
  • setting2.yaml

and at startup, setting1.yaml is loaded. (This can be configured in launch.py)

After that, I want to load setting2.yaml and apply parameters while running.

The ros2 version is eloquent.

I am using jetson and jetson's OS(Jetpack) is based on ubuntu18.04 so I cannot use foxy.

In the foxy manual, I found the following section.

6 ros2 param load You can load

parameters from a file to a currently running node using the command:

ros2 param load <node_name> <parameter_file>

https://docs.ros.org/en/foxy/Tutorials/Parameters/Understanding-ROS2-Parameters.html#ros2-param-load

However, there is no mention of this in the eloquent manual, and in fact the command resulted in an error.

https://docs.ros.org/en/eloquent/Tutorials/Parameters/Understanding-ROS2-Parameters.html

Any advice would be appreciated.


Originally posted by mutsuyuki on ROS Answers with karma: 21 on 2022-01-07

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Found this in the eloquent documentation:

https://docs.ros.org/en/eloquent/Tutorials/Parameters/Understanding-ROS2-Parameters.html#load-parameter-file

ros2 run <package_name> <executable_name> --ros-args --params-file <file_name>

Originally posted by osilva with karma: 1650 on 2022-01-07

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by mutsuyuki on 2022-01-08:
Thank you for your answer.

What I want to know is how to reload the parameter file during runtime, but the method you suggested is seems to how to read the parameter file at the start.

Comment by osilva on 2022-01-08:
In eloquent you need to stop node and reload as explained in the example.

Comment by osilva on 2022-01-08:
If you need this functionality you could start PR, this feature was introduced for Galactic but recently added to foxy: https://github.com/ros2/ros2cli/pull/596

Comment by mutsuyuki on 2022-01-08:
Thank you osilva. I understood that eloquent does not have the feature I'm looking for.

Comment by osilva on 2022-01-08:
It’s also offered with Rolling. If this resolves your question please accept the answer. Thank you

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.