colcon-bash is an extension for the colcon build system, primarily used in robotics development (e.g., ROS 2). It provides the functionality to generate Bash shell scripts (e.g., `setup.bash`) within colcon workspaces. These scripts are crucial for setting up the environment, allowing users to easily source packages and make their executables and libraries discoverable. The current version is 0.5.0, and it follows the colcon project's release cadence, often coinciding with ROS 2 releases or colcon-core updates.
pip install colcon-bashVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how `colcon-bash` integrates with `colcon`. After building a package, `colcon-bash` ensures that `install/setup.bash` is generated. Sourcing this script adds package-specific environment variables and PATH entries, allowing executables like `my_executable` to be run directly.
Install `colcon-zsh` for Zsh or `colcon-fish` for Fish, and use `source install/setup.zsh` or `source install/setup.fish` respectively.
Always start with a clean shell or carefully manage your environment. Use `source /opt/ros/{DISTRO}/setup.bash` first (for ROS 2), then your workspace's `source install/setup.bash`. Unset ROS environment variables before switching workspaces if conflicts occur.Run `source install/setup.bash` from your workspace root directory (`my_colcon_ws` in the quickstart example) to update your environment. Consider adding it to your shell's startup script (`.bashrc`) if it's your primary workspace.