colcon build
knows what to compile.# Create workspace
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
Now you have:
ros2_ws/
└── src/
After creating packages, go back to the workspace root and build:
cd ~/ros2_ws
colcon build
If build succeeds, new folders appear:
ros2_ws/
├── build/
├── install/
├── log/
└── src/
To use your new packages:
source /opt/ros/humble/setup.bash # source underlay
source ~/ros2_ws/install/local_setup.bash # source overlay
#you have to SOURCE so that your shell(terminal) can find ros2 packages and your workspace packages