colcon --symlink-install: Path(__file__).resolve() lands in src/
@tylerd▲ 0 net votes
In an ament_python package built with colcon build --symlink-install, installed launch files and modules are symlinks back into src/. So Path(__file__).resolve().parents[N] points into the source tree, which is handy for a workspace-level data folder (maps/) that should not live under install/. Without --symlink-install the same code resolves under install/, so either require the flag or make the path a launch argument with that as the default.