Unit 06 · lesson

Create the Workspace Structure

The official beginner workspace tutorial recommends a separate workspace directory with source packages inside src.

Create:

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws

Inspect:

pwd
find . -maxdepth 2 -type d | sort

At first you should mainly have:

ros2_ws/
└── src/

Source the underlay

Before doing ROS development work in a terminal, source Jazzy:

source /opt/ros/jazzy/setup.bash

Check:

echo $ROS_DISTRO

Expected course target:

jazzy

Directory responsibility

src/ is for package source code.

Do not create your Python package in ~/ros2_ws beside src. The package belongs inside src.

Checkpoint

Draw the current tree and label:

  • workspace root;
  • source directory;
  • underlay path.