Intro

picture 0
Gazebo brings a fresh approach to simulation with a complete toolbox of development libraries and cloud services to make simulation easy. Iterate fast on your new physical designs in realistic environments with high fidelity sensors streams. Test control strategies in safety, and take advantage of simulation in continuous integration tests.

history Gazebo is an open-source 2D/3D robotics simulator that began development in 2002. In 2017, development forked into two versions, known as “Gazebo”, the original monolithic architecture, and “Ignition”, which had moved to becoming a modernized collection of loosely coupled libraries. Following a trademark obstacle in 2022 regarding their use of the name “Ignition”, Open Robotics took the opportunity to switch the version names, dubbing the original fork “Gazebo Classic” and the new, modern fork “Gazebo”.

Gazebo Classic (Gazebo11)

  • Check if you have Gazebo
 gazebo --version
Gazebo multi-robot simulator, version 11.10.2
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org


Install Gazebo from source

Install Gazebo using the binary (Ubuntu) packages

AMD64

ARM64

  • For using PPAs for unsupported architectures like arm64 (note the warning below), see Gazebo on Raspberry Pi

Non-AMD64

On Ubuntu Jammy (22.04) Gazebo binaries are only available for amd64. ROS uses Ubuntu official packages for Gazebo so there are only amd64 ROS packages. Packages for arm64. armhf and ppc64 were released for the same version in Jammy in a PPA https://launchpad.net/~openrobotics/+archive/ubuntu/gazebo11-non-amd64 but there is no official support nor updates for these binaries.

”Currently, there is an apt package published for gazebo on amd64 for Ubuntu 22.04, but not for arm64. Is there a technical reason for this, or is it just a task to cross-compile and release it?”

ROS is not going to import arm versions of Gazebo11 for the following reasons:

  • Gazebo11 is going to be replaced by then new Gazebo, migration is recommended as soon as possible and the efforts will be focused in the new version.
  • The version in the PPA is not exactly the same than in Ubuntu since it needed some custom patches since some of its dependencies were not available on Ubuntu Jammy.

The packages in the PPA can be used without any guarantee, they probably will work as expected but there is no official support for them. If you are using ROS for gazebo_ros_pkgs, there won’t be packages for arm64 or amrhf but you can use the PPA to build them from source using a colcon/catkin workspace easily.

Gazebo via RoboStack

Install Gazebo on WSL2

  • Install Gazebo

    sudo apt update
    sudo apt install ros-humble-gazebo-ros-pkgs
  • Enable WSL2 Graphics Support

  • Install the WSL NVIDIA driver (for GPU Acceleration)

    • Ensure you have nvidia-container-toolkit installed for CUDA support.
  • Launch Gazebo from your terminal:

    gazebo

Troubleshooting

gazebo --verbose
  • Update permissions on runtime directory to fix QStandardPaths: wrong permissions on runtime directory /run/user/1000/, 0755 instead of 0700
chmod 0700 /run/user/1000/
  • Check Gazebo resources
ls /usr/share/gazebo-11/worlds/
  • Ensure that you have sourced the correct setup script for Gazebo
    • This may fix Unable to find shader lib. Shader generating will fail error
echo "source /usr/share/gazebo/setup.bash" >> ~/.bashrc

Gazebo11 and Garden Side by Side Installation

https://github.com/gazebosim/docs/blob/9383b6c4d0943772703c754a10b4cedddcab3db1/install_gz11_side_by_side.md#installing-the-new-packaging-from-the-ppa

  • Install gazebo11 from the PPA
sudo add-apt-repository ppa:openrobotics/gazebo11-gz-cli
sudo apt update
sudo apt-get install gazebo11
  • Verify installation
gazebo --version
Gazebo multi-robot simulator, version 11.14.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
apt-get install ros-humble-ros-gzgarden
  • Verify installation
gz sim --version
gz sim --version
Gazebo Sim, version 7.9.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.

Gazebo integration with ROS

  • Check if gazebo_ros_pkgs are available
sudo apt-cache search gazebo_ros_pkgs

gazebo_ros_pkgs is a set of ROS packages that provide the necessary interfaces to simulate a robot in the Gazebo 3D rigid body simulator for robots. It integrates with ROS using ROS messages, services and dynamic reconfigure.

  • Install from debian packages (on Ubuntu) [1/6/25 WSL]
sudo apt install ros-humble-gazebo-ros-pkgs
  • Launch a simple Gazebo world as a ROS node:
ros2 launch gazebo_ros gazebo.launch.py
  • Run the Gazebo simulation engine (physics, world logic) without GUI
ros2 launch gazebo_ros gzserver.launch.py

Test Gazebo and ROS2 integration

  • Load the differential drive world with Gazebo
gazebo --verbose /opt/ros/humble/share/gazebo_plugins/worlds/gazebo_ros_diff_drive_demo.world
  • Take a look at the world file, which has example commands at the top
gedit /opt/ros/humble/share/gazebo_plugins/worlds/gazebo_ros_diff_drive_demo.world
  • Run one of the sample commands to make the vehicle move forward
ros2 topic pub /demo/cmd_demo geometry_msgs/Twist '{linear: {x: 1.0}}' -1