After 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 finishes installing ROS2 Humble, it automatically appends several configuration lines to your ~/.bashrc file. These lines activate the ROS2 environment, overlay your colcon workspace, enable tab completion for colcon commands, and define a pair of convenience aliases — all of which are sourced every time you open a new terminal. This page explains what each line does and how to customize them to fit your workflow.
Lines Added to ~/.bashrc
The table below lists every entry that ros2_install.sh writes to your ~/.bashrc and describes its purpose.
| Line | Purpose |
|---|---|
alias nb='nano ~/.bashrc' | Opens ~/.bashrc in the Nano editor with a short command. |
alias sb='source ~/.bashrc' | Reloads ~/.bashrc in the current shell without opening a new terminal. |
source /opt/ros/humble/setup.bash | Activates the core ROS2 Humble environment — makes ros2, rviz2, and all system-level packages available. |
source ~/colcon_ws/install/setup.bash | Activates the colcon workspace overlay so packages you build locally are found by ROS2. |
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash | Enables <Tab> completion for all colcon sub-commands and options. |
export ROS_DOMAIN_ID=0 | Sets the DDS domain identifier to 0 (the default). Nodes must share the same domain ID to communicate. |
After running
ros2_install.sh, open a new terminal or run source ~/.bashrc (alias: sb) for every change to take effect. The installer does not automatically reload your current shell session.Applying Changes After Editing .bashrc
Make your edits
Modify the relevant lines — for example, changing
ROS_DOMAIN_ID or adding new aliases.Understanding ROS_DOMAIN_ID
ROS2 uses the DDS (Data Distribution Service) middleware for communication. The ROS_DOMAIN_ID environment variable controls which DDS domain your nodes join. Nodes on different domain IDs cannot communicate, even if they run on the same machine or the same network.
Valid range
0 through 101. The default set by ros2_install.sh is 0.When to change it
Change to any unique number (1–101) when sharing a network with other ROS2 users to prevent cross-talk between unrelated robots.
~/.bashrc and update the export line:
Verifying the Environment Is Active
Run the following commands after sourcing your~/.bashrc to confirm ROS2 Humble is properly activated:
ros2_install.sh completed without errors and that you have sourced ~/.bashrc in the current terminal.
Editing .bashrc Manually
You can open the file at any time using the alias added by the installer or via a direct Nano command:
Ctrl+O, then Enter to confirm, then Ctrl+X to exit Nano), always reload the file: