TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xXThanatosXx/MobileRobot/llms.txt
Use this file to discover all available pages before exploring further.
ros2_install.sh script does more than install the ROS2 Humble binaries — it also creates a fully initialized colcon workspace at ~/colcon_ws/src and runs an initial colcon build to verify everything is working. This page covers the workspace directory layout, how to build packages incrementally, how to install dependencies with rosdep, and the overlay sourcing that ties everything together in your shell. For details on the environment variables and aliases that ros2_install.sh adds to your ~/.bashrc, see ROS2 Environment.
Workspace Directory Layout
Afterros2_install.sh completes, your home directory contains the following workspace structure:
src/
The only directory you work in directly. Clone or create ROS2 packages here.
colcon build discovers packages by scanning this tree.build/
Intermediate build artifacts generated automatically. Never edit files here — they are overwritten on every build.
install/
The workspace overlay that is sourced in
~/.bashrc. Contains the executables, libraries, and resource index for every built package.log/
Detailed per-package build logs. Useful for diagnosing compile errors without re-running the full build.
The workspace source line (
source ~/colcon_ws/install/setup.bash) is appended to ~/.bashrc by ros2_install.sh, so every new terminal session automatically activates the workspace overlay — you do not need to source it manually.Building the Workspace
Run the build
Build all packages in the workspace with symlink install enabled:The
--symlink-install flag creates symbolic links to your source files instead of copying them into install/. This means changes to Python scripts are reflected immediately without requiring a rebuild — only C++ or CMake changes require a new colcon build.Verify the build succeeded
A successful build ends with a summary line like:If any package reports
failed or aborted, check ~/colcon_ws/log/latest_build/ for the detailed output of the failing package.Rebuilding a Single Package
Rebuilding the entire workspace every time is unnecessary when you are iterating on a single package. Use the--packages-select flag to target only the package you changed:
Sourcing the Workspace Overlay
The workspace overlay is theinstall/ directory. It must be sourced so that ros2 run, ros2 launch, and other tools can find your locally built packages:
ros2_install.sh appended this line to ~/.bashrc, every new terminal session sources it automatically. You only need to run it manually if you are in a session that pre-dates the installation or if you have customized your shell startup files.
Managing Dependencies with rosdep
rosdep resolves and installs system-level and ROS-level dependencies declared in your packages’ package.xml files. Run the following commands to keep dependencies up to date before building:
| Flag | Meaning |
|---|---|
--from-paths src | Scan ~/colcon_ws/src for package.xml files to discover all declared dependencies. |
--ignore-src | Skip packages whose source is already present in src/ — only install external deps. |
-r | Continue installing even if a dependency resolution fails for one package. |
-y | Answer yes automatically to all apt prompts. |
ros2_install.sh calls rosdep update once during installation to populate the local package index. Re-run rosdep update periodically to pull in the latest index before installing new packages.
Adding a New Package
Next Steps
For details on every environment variable and alias thatros2_install.sh writes to your shell — including ROS_DOMAIN_ID and colcon tab completion — see the ROS2 Environment page.