Sourcing the ROS 2 Workspace
How ROS 2 learns where your packages live
Created by Tech Arcanist
Core Idea
ROS 2 does NOT auto-detect workspaces
Click to understand
ROS 2 has no idea where your packages are
unless you explicitly tell it.
This “telling” process is called sourcing.
Why install/ Matters
colcon build → install/setup.bash
Click to understand
After building, ROS 2 creates:
install/setup.bash
This file contains:
• Package paths
• Executable locations
• Environment variables
Sourcing the Workspace
cd install
. setup.bash
Click to understand
The dot (.) means:
“Apply these settings to THIS terminal.”
After sourcing, the terminal becomes ROS-aware.
What Changes After Sourcing
Terminal → ROS-aware
Click to understand
• ROS 2 can find your packages
• Nodes become runnable
• ros2 pkg list shows your workspace packages
New Terminal Problem
New terminal → empty environment
Click to understand
Each terminal has its own environment.
Opening a new terminal = ROS forgets your workspace
until you source again.