colcon is ROS’s meta build system: it builds packages and manages dependencies across a workspace. A workspace keeps source packages in src and generated build, install, and log directories alongside them. section 4.3
A typical colcon workflow is:
- Create a workspace such as ~/rfp_ws and place packages in ~/rfp_ws/src. section 4.3
- Run colcon build --symlink-install from the workspace’s top-level directory, not from src. section 4.3
- Use build for intermediate files, install for installed artifacts and setup scripts, and log for build records. section 4.3
- Source the generated install/setup.sh before using built packages, then verify or run them with ROS 2 commands. section 4.3
cd ~/rfp_ws colcon build --symlink-install
Build the workspace with symlink installation, which supports concurrent development across modular ROS packages. section 4.3
Building and running a package
After cloning a package into ~/rfp_ws/src, run colcon build --symlink-install from ~/rfp_ws, source ~/rfp_ws/install/setup.sh, and launch the package with ros2 run. section 4.3
