Harmonic And Jazzy Tutorial
Setting up Gazebo Harmonic
Introduction and explanation
What software are we using and why
All of these instructions have been tested using the current version of Ubuntu: Noble Numbat.We are going to use two packages: Gazebo for the physics based Simulator and ROS2 (Robot Operating System) for the control system. There are many releases of each of these, and only some combinations are mutually compatible. Also, since we are focusing on a stable development platform, we will use the Long Term Support (LTS) versions that are current at the time we are posting this.
How will the demonstration proceed.We will go through 7 steps: 1) Install Gazebo Harmonic and confirm that it is correct. 2) Examine an empty world 3) Build a simple robot and test it using keyboard controls. 4) Build a 'world' for our robot to explore. 5) Install ROS2 (and its components) and confirm the installation. 6) Add Lidar to the robot 7) Write control software in ROS2 to make the robot autonomous.
This post covers Step 1
How will the demonstration proceed.We will go through 7 steps: 1) Install Gazebo Harmonic and confirm that it is correct. 2) Examine an empty world 3) Build a simple robot and test it using keyboard controls. 4) Build a 'world' for our robot to explore. 5) Install ROS2 (and its components) and confirm the installation. 6) Add Lidar to the robot 7) Write control software in ROS2 to make the robot autonomous.
This post covers Step 1
NOTE: If you already have a working copy of Gazebo Harmonic installed, you can skip ahead to Examining an Empty World
Install Gazebo Harmonic
Before doing any software install, make sure your system is up to date > sudo apt-get update > sudo apt-get upgrade
Get Privacy Guard so that you can pull the Gazebo package > sudo apt-get install lsb-release wget gnupg(These may already be installed)Get the pgp signature >sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
Installing Gazebo > echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
> sudo apt-get update > sudo apt-get install gz-harmonic
Get Privacy Guard so that you can pull the Gazebo package > sudo apt-get install lsb-release wget gnupg(These may already be installed)Get the pgp signature >sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
Installing Gazebo > echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
> sudo apt-get update > sudo apt-get install gz-harmonic
Confirm your installation
At a command prompt type: > gz sim empty.sdfYou should see the following screen:
Notes: * You may get a warning about
libEGL warning: egl: failed to create dri2 screen
you can ignore this.
* We have only tested on Ubuntu Numbat 24.04 build * These instructions were adapted from here:
building an empty world
The next thing we are going to do is to save the empty world, so we can look at the parts that make it up.
If Gazebo is not open, begin by launching gazebo with this command: > gz sim empty.sdf
So that you see the screen above
With that click, you have launched two programs, one is the visible one - the Gazebo client interface, the second is invisible, running in the background: the Gazebo Simulation Server.
The interface is broken up into a top bar and two main panels.
The top bar has a menu hamburger on the left and a plugin pull down on the right.
The left panel is a visualization screen, currently showing an infinite plane with grid lines around the origin point.
The right panel is showing information about the settings for the simulation.
We'll talk about these next.
But first, let's save a copy of this empty world and look at its parts.
Use the gazebo menu (select the hamburger in the upper left and choose 'Save World ...' ) save this as
pong-world-1.sdfOpen the file in a text editor and look at it. It is 89 lines of xml that defines the world. We will examine it in detail in the next part of the tutorial.
Previous Step | Current Step | Next Step |
Installing Gazebo |