Documentation 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 is the primary installation script for the MobileRobot course. It fully automates ROS2 Humble setup on Ubuntu 22.04 — handling locale configuration, APT source registration, package installation, colcon workspace creation, rosdep initialization, and shell environment configuration — so students can go from a fresh Ubuntu install to a working ROS2 environment in a single command.
Script Location
The script lives atScripts/ros2_install.sh in the MobileRobot repository.
Running the Script
Navigate to the directory where you downloaded the script, make it executable, and run it:The script prints a confirmation prompt immediately after launch and then waits up to 10 seconds for you to press
Enter (or CTRL+C to abort). Use that window to double-check the displayed configuration before the installation begins.Configurable Variables
Three variables near the top of the script control what gets installed and where the workspace is created. Edit them before running if you need different values:| Variable | Default | Purpose |
|---|---|---|
name_ros_version | 'humble' | ROS2 distribution name used in every package and path reference |
ros2_pkg | 'desktop' | Package variant to install — desktop includes GUI tools such as RViz; alternatives are desktop-full and ros-base |
name_workspace | 'colcon_ws' | Name of the colcon workspace directory created under $HOME |
Step-by-Step Execution Flow
Distro conflict warning
The script immediately prints a warning reminding you to comment out any existing ROS distro source lines in
~/.bashrc, then pauses for you to press Enter.Display configuration and confirm
The resolved values of
name_ros_version, ros2_pkg, and name_workspace are printed so you can verify them. The script then waits up to 10 seconds — press Enter to continue or CTRL+C to cancel.Set up APT sources
Installs prerequisite tools, downloads the official ROS2 GPG signing key, and registers the ROS2 APT repository:
Install ROS2 Humble Desktop
Installs the full desktop variant of ROS2 Humble (includes RViz, rqt, and all core libraries):
Install Python tooling
Sources the freshly installed ROS2 environment and installs the Python utilities needed for building and managing packages:
Create the colcon workspace
Creates the
colcon_ws workspace directory (or whichever name you set in name_workspace) and runs an initial build to verify the setup:~/.bashrc Additions
After the installation completes, the script appends the following lines to your~/.bashrc:
| Line | Purpose |
|---|---|
alias nb | Opens ~/.bashrc in nano for quick editing |
alias sb | Re-sources ~/.bashrc in the current shell without restarting the terminal |
source /opt/ros/humble/setup.bash | Puts all ROS2 Humble executables and libraries on your PATH / PYTHONPATH |
source ~/colcon_ws/install/setup.bash | Overlays your local workspace packages on top of the ROS2 install |
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash | Enables TAB completion for colcon commands |
export ROS_DOMAIN_ID=0 | Scopes DDS discovery to domain 0; change this if running multiple robots on the same network |
ROS_DOMAIN_ID=0 is the default and works for single-machine development. If you are running multiple robots or developers on the same LAN, assign each machine a unique domain ID (0–101) to prevent cross-talk between unrelated nodes.