liveBook · Manning

ROS workspace

As explained in Robotics for Programmers

A ROS workspace is a directory structure containing ROS packages and the build and installation artifacts generated for them.

A ROS workspace is a directory with a defined internal structure for storing, building, and running ROS packages. Packages live in src; colcon creates build, install, and log directories for generated artifacts, environment setup, and build records. section 4.3

A typical workspace workflow is:

  • Create the workspace and its src directory, then place new or cloned packages under src. section 4.3
  • Run colcon build from the workspace's top-level directory, not from a subdirectory. section 4.3
  • Source install/setup.sh so ROS tools can discover the built packages. section 4.3
  • Verify discovery with ros2 pkg list or ros2 pkg prefix. section 4.3 section 4.7

Build and expose a package

For ~/rfp_ws, create a Python package in src, build from ~/rfp_ws with colcon build --symlink-install, source the install setup script, and run the package through ros2. section 4.3 section 4.7

mkdir -p ~/rfp_ws/src

Create the conventional workspace and source directory before adding ROS packages. section 4.3

cd ~/rfp_ws
colcon build --symlink-install

Build all packages from the workspace root while preserving source-file links during development. section 4.3

How Robotics for Programmers covers it

How deep it goes
Explains directory roles, build location, environment sourcing, and package verification, but stops short of colcon internals.
Examples
Uses ~/rfp_ws, cloned packages, Python package creation, custom messages, ros2 verification, and build artifacts.
What it assumes
Assumes ROS installation and environment setup, while teaching workspace structure, package placement, building, sourcing, and verification.
What you can do after
Operate/configure a workspace by creating packages, building them with colcon, sourcing install/setup.sh, and verifying ROS discovery.
How it connects
Connects ROS packages, colcon, ROS nodes, ROS topics, ros2, and environment setup.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Robotics for Programmers. The section links point to the parts of the book it draws on.