liveBook · Manning

Colcon

As explained in Robotics for Programmers

colcon is a command-line build tool for building ROS packages and managing their dependencies across a workspace.

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

How Robotics for Programmers covers it

How deep it goes
Explains workspace layout, build location, generated directories, environment setup, and package execution without detailing colcon internals.
Examples
Uses a cloned ROS package, ~/rfp_ws, colcon build --symlink-install, generated directories, and ros2 run.
What it assumes
Assumes ROS installation and environment setup, while introducing package files, workspace structure, and the build workflow.
What you can do after
Operate a ROS workspace by creating packages, building them with colcon, sourcing installation files, and running executables.
How it connects
Connects ROS packages, workspaces, dependencies, setup scripts, and the ros2 command-line tool.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Robotics for Programmers. The section links point to the parts of the book it draws on.