1.1 Install ROS 2 Jazzy
In this tutorial, we will install ROS 2 Jazzy, Gazebo Harmonic and some useful packages.
You will need a computer or virtual machine running Ubuntu 24.04, and you can create a virtual machine from scratch as following video:
Introduction
ROS2 Jazzy Jalisco is the latest Long-term support version in 2025 that works comatible with Gazebo Harmonic:
For Gazebo simulator, there might be confusing about its version, and let's make it clear:
Basically, the "old" versions of gazebo is called classic like Gazebo 11 (Gazebo+VersionNo.)
There used to be a new Gazebo version called Ignition to replace the classic.
For some reason, Ignition is renamed to Gazebo again, and use Gazebo+VersionName for the new generations of Gazebo simulator.
Although the new Gazebo has a different user interface with the classic, most of fundamental designs are same or similar, so it is not difficult to move to the new version. While there are lots of differences like the plugins, we will cover this in future tutorials.
For Gazebo Harmonic installation, there are two ways:
Install and run Gazebo Harmonic independently from ROS2.
Install and run Gazebo Harmonic with ROS2. For ROS developers, I recommend this way.
Install ROS2 Jazzy
Installation procedure
Set Up the Environment Variables
After installation, you need to set up the important environment variables, which tell your computer how to find and use ROS 2 commands and packages. Open a terminal and type:
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrcThis wil add the line source /opt/ros/jazzy/setup.bash to your ~/.bashrc file.
Why do this? Each time you open a new terminal window, you are starting a bash session. The bash session needs to know what version of ROS 2 you are using. By adding this line, you can use ROS 2 Jazzy commands and tools without having to manually run the setup.bash script every time.
To take effect, open a new terminal window, or run following cmd in the current terminal:
source ~/.bashrcYou can verify that line was added by typing:
sudo apt-get install gedit -y
gedit ~/.bashrcCheck environment variables
If you ever have problems finding or using your ROS 2 packages, make sure that your environment is properly set up using the following command:
printenv | grep -i ROS
# Also, you can type:
echo $ROS_DISTRO
printenv ROS_DISTRO
lsb_release -a #check UbuntuIf the environment variables are not set correctly, return to the ROS 2 package installation section.
Set up the system to manage ROS package dependencies.
sudo rosdep init
rosdep updateRun ROS2 example - Turtlesim
Install turtlesim
sudo apt update
sudo apt install ros-jazzy-turtlesimStart turtlesim
ros2 run turtlesim turtlesim_nodeOpen a new terminal and run control node
ros2 run turtlesim turtle_teleop_keyInstall and run rqt tool
sudo apt update
sudo apt install '~nros-jazzy-rqt*'
rqtInstall Gazebo Harmonic
To install Gazebo Harmonic binaries on Ubuntu 24.04 simply follow the steps on this link.
sudo apt-get install ros-${ROS_DISTRO}-ros-gz -yTest Gazebo Installation
If you want to run an example Gazebo simulation world now, you can type:
LIBGL_ALWAYS_SOFTWARE=1 QT_QPA_PLATFORM=xcb gz sim -v 4 shapes.sdfTo make these environment variables permanent, open a terminal window and type:
echo 'export LIBGL_ALWAYS_SOFTWARE=1' >> ~/.bashrc
echo 'export QT_QPA_PLATFORM=xcb' >> ~/.bashrc
source ~/.bashrcNow test your Gazebo installation again by typing the following command:
gz simClick on one simulation, and click Run. Close the simulation by typing CTRL + C in the terminal window.
Install useful tools
Let’s install some other useful packages like pip (the Python package manager), NumPy (a scientific computing library for Python) etc.
sudo apt-get install python3-vcstool
sudo apt-get install python3 python3-pip -y
sudo apt-get install python3-numpyInstall terminator to show multiple terminal windows in a single window.
sudo apt-get install terminator -y
# to run it, type:
terminatorRight-click on the terminator screen, and click “Split Horizontally”.
References:
https://docs.ros.org/en/rolling/Releases.html https://docs.ros.org/en/jazzy/Installation.html#
https://gazebosim.org/home https://gazebosim.org/docs/harmonic/ros_installation/
Last updated

