Installation & build
Do this once and you are ready for every module. All lessons from here on assume you have completed the steps on this page: the workspace is built and you have sourced the setup file in your terminal.
After this lesson you will have
- ROS 2 Humble and Gazebo Fortress running on your computer
- The
atlas_simrepository cloned and built successfully withcolcon - A sample command that runs successfully to confirm everything is set up correctly
1. Operating system
You need Ubuntu 22.04 installed directly or alongside Windows (dual boot) — how to install it, and why not to use a virtual machine, is in Installing Ubuntu alongside Windows. WSL2 on Windows works for the early modules, but Gazebo and RViz often hit graphics errors there. Run the steps below in that Ubuntu environment's terminal.
2. Install ROS 2 Humble
Skip this step if ROS 2 Humble is already installed (echo $ROS_DISTRO prints humble).
locale # check for UTF-8; if missing, run the 3 lines below
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt install ros-humble-desktop ros-dev-tools
source /opt/ros/humble/setup.bash
This is the standard ROS 2 procedure at the time of writing. If a command fails because ROS has changed a key or URL, search for "ros2 humble install ubuntu debian" to find the updated instructions.
3. Install Gazebo Fortress and the packages Atlas needs
Atlas uses Gazebo Fortress through ros-humble-ros-gz — not Gazebo Classic (ros-humble-gazebo-*, which has a similar name but is an older, incompatible version).
sudo apt-get update
sudo apt-get install -y ros-humble-ros-gz ros-humble-gz-ros2-control \
ros-humble-slam-toolbox ros-humble-navigation2 ros-humble-nav2-bringup \
ros-humble-teleop-twist-keyboard ros-humble-joy ros-humble-teleop-twist-joy \
ros-humble-twist-mux
4. Clone and build the repository
git clone https://github.com/atlasroboticsvn/atlas_sim.git ~/atlas_sim
cd ~/atlas_sim
source /opt/ros/humble/setup.bash
colcon build
source install/setup.bash
source install/setup.bash only affects the current terminal. You must run it again when you open a new terminal — or add the 2 source lines to the end of ~/.bashrc so you do not have to type them each time.
5. Check that everything works
This command only opens RViz to display the robot; it does not need Gazebo yet — it is lightweight and suitable for a quick check:
ros2 launch atlas_description display.launch.py
If an RViz window opens with the Atlas robot model, the build is correct. Close the window (Ctrl+C in the terminal), then try the more demanding step — launching Gazebo itself:
ros2 launch atlas_control controller.launch.py world:=maze.sdf
If you see the robot standing in the maze in Gazebo, your computer is ready for the entire course.
Conventions used in every lesson
From Module 1 onward, every ros2 command assumes you are in ~/atlas_sim, in a terminal where you have run source install/setup.bash. When a lesson requires several commands to run at the same time (for example, one command keeps its terminal running indefinitely), it will explicitly label them "Terminal 1", "Terminal 2" — open that many terminals and copy each command block into the correct one.
Common installation errors
gz sim syntax. Use ign gazebo instead.python3-colcon-common-extensions is missing: sudo apt install python3-colcon-common-extensionssource install/setup.bash in the current terminal, or colcon build has not finished yet.