Unit 06 · lesson

Put Source Packages in `src`

Put Source Packages in src

A workspace becomes useful when src contains ROS packages.

The official workspace tutorial clones the Jazzy branch of ros_tutorials as an example:

cd ~/ros2_ws/src
git clone https://github.com/ros/ros_tutorials.git -b jazzy

Then inspect:

find ~/ros2_ws/src -maxdepth 3 -name package.xml -print

package.xml is one of the strongest clues that a directory is a ROS package.

Repository versus package

A Git repository may contain more than one ROS package.

Do not assume:

one Git repository = one ROS package

ROS tooling operates around package metadata, not just Git repository boundaries.

Keep the root clean

Your workspace root will later contain generated directories named build, install, and log. Keeping source code under src separates editable inputs from generated build artifacts.

Checkpoint

Record:

Workspace root:
Source root:
Repository cloned:
ROS package.xml files discovered: