ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Is it possible to load the parameters file while running?

asked 2022-01-07 09:40:26 -0600

mutsuyuki gravatar image

updated 2022-01-07 21:21:40 -0600

osilva gravatar image

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/Tutorial...

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/Tuto...

Any advice would be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-01-07 21:05:46 -0600

osilva gravatar image

Found this in the eloquent documentation:

https://docs.ros.org/en/eloquent/Tuto...

ros2 run <package_name> <executable_name> --ros-args --params-file <file_name>
edit flag offensive delete link more

Comments

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.

mutsuyuki gravatar image mutsuyuki  ( 2022-01-08 08:00:27 -0600 )edit
1

In eloquent you need to stop node and reload as explained in the example.

osilva gravatar image osilva  ( 2022-01-08 08:23:50 -0600 )edit
1

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

osilva gravatar image osilva  ( 2022-01-08 08:32:00 -0600 )edit

Thank you osilva. I understood that eloquent does not have the feature I'm looking for.

mutsuyuki gravatar image mutsuyuki  ( 2022-01-08 08:34:24 -0600 )edit

It’s also offered with Rolling. If this resolves your question please accept the answer. Thank you

osilva gravatar image osilva  ( 2022-01-08 08:35:43 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2022-01-07 09:40:26 -0600

Seen: 384 times

Last updated: Jan 07 '22