ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
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 -0500

a.g 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 image gvdhoorn  ( 2020-02-13 02:32:54 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

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

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
3

answered 2020-10-12 12:23:45 -0500

guru_florida gravatar image
colcon build --symlink-install

As Steve Macenski mentioned in the last line. The symlink option creates symlinks in the install directory instead of copying the files. As long as you dont add files to your project you dont have to keep colcon-building for py, urdf or yaml file changes.

edit flag offensive delete link more

Comments

This is not true. You should bother trying this out before commenting this solution. The python package is linked, but all resources, including .yaml and .launch.py files are just copied using --symlink-install.

Karl gravatar image Karl  ( 2022-07-12 04:29:48 -0500 )edit

Question Tools

3 followers

Stats

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

Seen: 2,127 times

Last updated: Oct 12 '20