📌 Overlay & Underlay

🔑 Rule: Always source the underlay first, then the overlay.


🔌 Sourcing (Activating Environments)

Sourcing is how you tell your terminal which ROS environment to use:

📌 You must source again every time you open a new terminal (unless added to .bashrc).

🔑 Example workflow:

source /opt/ros/humble/setup.bash   # underlay
source ~/ros2_ws/install/local_setup.bash   # overlay

📂 File Configuration (workspace layout)

  1. make ros2_ws/src directory

mkdir -p ~/ros2_ws/src 2. go back to ros2_ws and do colcon build 3. When you run colcon build, a workspace looks like this

ros2_ws/
 ├── build/    # temporary build files
 ├── install/  # executables, scripts, setup files (you source this!)
 ├── log/      # build & run logs
 └── src/      # where your packages live


📦 What is a Package?