Workspaces, underlays and overlays
ROS 2 → Packages, workspaces and colcon
Underlay and overlay have different jobs
The package tutorial starts with a workspace directory and a src folder. Your installed ROS environment supplies the underlay; building your packages creates an overlay you can source later.
Video by Josh Newans / Articulated Robotics ↗ · Starts at 0:16
Lesson notes
- Build from the workspace root, above src/.
- Generated build, install and log directories are separate from source.
- The video names its workspace dev_ws; our small foundation example uses ros2_ws.
Related videos for this lesson
- Docker 101 ↗
Optional: learn container basics before trying a container-based workspace.
Series: Docker for Robotics ↗
Build it step by step
Follow these commands in order using Ubuntu 24.04, ROS 2 Jazzy and Bash. Read each prerequisite before running a block.
Create the course workspace
Complete installation first. Use ros2_ws for the small foundation examples; keep it separate from any existing robot project.
source /opt/ros/jazzy/setup.bash mkdir -p ~/ros2_ws/src cd ~/ros2_ws pwd ls
Expected: You are in ros2_ws with a src directory. The next lesson adds a package; build/, install/ and log/ appear after building.
If it fails: Do not source install/setup.bash before a successful build creates it. Build from the workspace root, not from src or from inside a package.
Source documentation:
Explain it in your own words
Which directory should contain package source?
Compare your explanation
The workspace's src directory. The generated install directory contains the built environment, not your editable source.
Completion saves automatically after you read through to the end.
Next lesson →