Ask Your Question
0

Set parameters in ROS2 using a yaml file without needing to build the package every time

asked 2020-02-12 14:42:51 -0600

ayush.ghosh gravatar image

I have been able to include a parameter.yaml file in my test.launch.py file. However if I modify the parameter.yaml file, I need to build the entire package again before seeing changes reflected when I rerun test.launch.py.

In ROS1 this was not an issue as we could just change our parameters config file and rerun roslaunch.

Is there a way to ensure we don't need to rebuild every time we modify the paramter.yaml file?

edit retag flag offensive close merge delete

Comments

However if I modify the parameter.yaml file, I need to build the entire package again before seeing changes reflected when I rerun test.launch.py.

just to be clear: the "rebuild" is only needed to copy over the latest version of your .parameter.yaml. Not because the configuration is baked into the node.

Compare with pip when you have installed a locally developed package without -e.

gvdhoorn gravatar imagegvdhoorn ( 2020-02-13 02:32:54 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-02-12 15:42:05 -0600

I need to build the entire package again before seeing changes reflected when I rerun test.launch.py.

Well, is your configuration file in your package? That would then be true with colcon build. You can also have your launch file reference a non-package non-install path if its a global configuration so you won't have that issue. Its looking for the version of the yaml file in the package's install path which will not be updated unless you build again. You can instead look for a global path /path/to/yaml.yaml and that way its not being updated or searching in the install space of the package itself. That may not be appropriate for your applications but that's an option.

Symlink install in colcon will help with this issue with python files, but it may be able to work here as well, but I'm not certain off hand.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-02-12 14:42:51 -0600

Seen: 12 times

Last updated: Feb 12