Gazebo simulation - cpslabor-education/robotwiki GitHub Wiki

Preface

Beginning with ROS 2 humble, Gazebo uses the new Gazebo derived from Ignition Gazebo: https://gazebosim.org/home

Newest version running with ROS 2 Humble is Gazebo Garden.

Installation

Installing Gazebo Garden

Installation instructions are derived from here: https://gazebosim.org/docs/garden/install_ubuntu

Instructions as the following:

sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
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-garden

Basically, add OSRF repository to your Deb repository list, update, then install Gazebo.

Try your simulation (the following works with WSL as well):

Workarounds for VMs

If you're using a VM or WSL:

gz sim --render-engine ogre

Or other choice is, to set LIBGL_ALWAYS_SOFTWARE flag (as of 2023):

export LIBGL_ALWAYS_SOFTWARE=1
gz sim

Enjoy the view of the robot: image Other scene: image

Uninstallation

If uninstallation is required - in case anything goes wrong, or want to try other version:

sudo apt remove gz-garden && sudo apt autoremove

Installing ROS tools for Gazebo