- Windows 10/11
- WSL 2
- Ubuntu 24.04 LTS
- ROS 2 Jazzy
- Gazebo Harmonic
Notes:
- Please select branch -version1
- Do not install
gazeboorgazebo11 gazeborefers to Gazebo Classic, not Gazebo Harmonic
Open PowerShell as Administrator and run:
wsl --installCheck WSL status:
wsl --status
wsl --versionSet WSL 2 as default:
wsl --set-default-version 2Update WSL if needed:
wsl --updateList available distributions:
wsl --list --onlineInstall Ubuntu 24.04:
wsl --install -d Ubuntu-24.04If the download gets stuck:
wsl --install --web-download -d Ubuntu-24.04Launch Ubuntu:
wsl -d Ubuntu-24.04On first launch, create your Linux username and password.
Check Ubuntu version:
lsb_release -a
uname -asudo apt update
sudo apt upgrade -y
sudo apt install -y curl gnupg lsb-release software-properties-common localessudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
localeEnable the universe repository:
sudo add-apt-repository universe
sudo apt updateAdd the ROS 2 apt source:
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F'"' '{print $4}')
curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo ${UBUNTU_CODENAME:-${VERSION_CODENAME}})_all.deb"
sudo dpkg -i /tmp/ros2-apt-source.debInstall ROS 2 Jazzy:
sudo apt update
sudo apt upgrade -y
sudo apt install -y ros-jazzy-desktop ros-dev-toolsLoad ROS automatically:
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
source ~/.bashrcVerify ROS:
printenv ROS_DISTRO
which ros2
ros2 topic -hExpected:
ROS_DISTRO=jazzyros2exists in/opt/ros/jazzy/bin/ros2
Add the Gazebo apt source:
sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] https://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt updateInstall Gazebo Harmonic:
sudo apt install -y gz-harmonicInstall ROS-Gazebo integration:
sudo apt install -y ros-jazzy-ros-gzVerify Gazebo:
which gz
gz sim --versionLaunch Gazebo directly:
gz simLaunch an empty world:
gz sim empty.sdfLaunch Gazebo from ROS:
ros2 launch ros_gz_sim gz_sim.launch.py gz_args:=empty.sdfRecommended ~/.bashrc entries:
source /opt/ros/jazzy/setup.bash
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8Reload:
source ~/.bashrcWSL:
wsl --status
wsl --version
wsl --list --verboseUbuntu:
lsb_release -aROS:
printenv ROS_DISTRO
which ros2
ros2 topic listGazebo:
which gz
gz sim --versionWSL install stuck:
wsl --shutdown
wsl --update
wsl --install --web-download -d Ubuntu-24.04Wsl/InstallDistro/0x80072f78:
- switch network
- disable proxy or filtering software
- retry with
--web-download
ros2 --version fails:
- this is normal
- use
printenv ROS_DISTRO,which ros2, orros2 topic -h
gz: command not found:
- Gazebo Harmonic is not installed correctly
- repeat Section 6
Gazebo GUI does not open in WSL:
- check WSLg
- update WSL
- check graphics driver support
Run:
printenv ROS_DISTRO
which ros2
which gz
gz sim --version
ros2 launch ros_gz_sim gz_sim.launch.py gz_args:=empty.sdfExpected:
- ROS 2 Jazzy is available
- Gazebo Harmonic is available
- Gazebo launches correctly
After the environment is ready, use the following workflow to build the ROS 2 workspace and launch the simulation scenes.
If colcon is not installed yet, run:
sudo apt update
sudo apt install -y python3-colcon-common-extensionsVerify:
colcon --helpGo to your ROS 2 workspace root directory:
cd ~/your_wsBuild the packages:
colcon buildAfter building, refresh the environment:
source install/setup.bashIf needed, run the ROS global setup first:
source /opt/ros/jazzy/setup.bash
source install/setup.bashRun the required launch file after sourcing the workspace.
Scene 1: Elevator Area
ros2 launch hmi_scene scene_state_publishers.launchScene 2: Open Field
ros2 launch hmi_scene open_area_scene.launchUse the following order each time:
cd ~/your_ws
source /opt/ros/jazzy/setup.bash
colcon build
source install/setup.bash
ros2 launch hmi_test experiment_logger.launch.py
ros2 launch hmi_scene open_area_scene.launchor
cd ~/your_ws
source /opt/ros/jazzy/setup.bash
colcon build
source install/setup.bash
ros2 launch hmi_test experiment_logger.launch.py
ros2 launch hmi_scene scene_state_publishers.launch