Colcon Build from Any Directory and Need to Re-build for changes in Launch file
New to ROS2 and Nav2 here.
Currently, my directory structure is like this:
home>nav2_ws>src>navigation2
. I need my build and install directory to be in nav2_ws. For which currently I callcolcon build --symlink-install
while in~/nav2_ws
. In ros1- catkin build, I used to call it from anywhere in the workspace (after initialization), and it used to build it at the same location. Is there a quick way to set a single build space and install space in colcon, so that colcon build could be called from anywhere in the workspace?while using
colcon build --symlink-install
, it ‘installs’ the workspace, due to which ros2 launch uses all the launch files from the “share” directory (not from the src directory). Now if we change anything in the launch file (src dir), it won’t be reflected in the share directory unless we again docolcon build --symlink-install
. Is there way to simplify this? so that user doesn’t have to build it again and again for changes in the launch file?
Ros version - foxy
There's been some talk about item 1 and a proposed change too, respectively https://github.com/colcon/colcon-core... and https://github.com/colcon/colcon-core...
As for item 2, there's a workaround here: https://github.com/colcon/colcon-core.... It was mentioned in that issue that newer versions of
setuptools
should allow for symlinking instead of copying, but I'm not sure if it actually happened/is available through colcon.Thought I'd clarify some potential confusion based on the question wording.
colcon
always installs things into theinstall/
dir and the ros2 tools never use anything fromsrc/
. What happens with--symlink-install
is those files underneathinstall/
are just links back to the originals undersrc/
so you can change them and see it take effect without rebuilding. @christophebedard is referring to a bug where python packages don't create those links when they ideally should. It's not clear from the question if that's the problem you're running into.