[Usage] Using Gazebo on Windows - cpslabor-education/robotwiki GitHub Wiki

Using Gazebo on Windows

Installation of ROS2

Follow the instructions here, for a relatively small installation bundle (~4-5 GB): https://microsoft.github.io/Win-RoS-Landing-Page/, and more specifically here: https://ms-iot.github.io/ROSOnWindows/GettingStarted/SetupRos2.html

You can alternatively setup by using the detailed description listed on https://docs.ros.org/en/foxy/Installation/Windows-Install-Binary.html, but for most use-cases the Microsoft bundle is sufficient enough.

Preliminary steps for Gazebo

In your user, make a new folder in the .gazebo folder, called as models. This is where the client will download the mdoels from Ignition servers.

Starting Gazebo

After successful installation, you can start Gazebo.

Open two Developer Command Prompt for VS 2019.

In one of them, start to enter the following commands (server):

c:\opt\ros\foxy\x64\setup.bat
c:\opt\ros\foxy\x64\share\gazebo\setup.bat
set "SDF_PATH=c:\opt\ros\foxy\x64\share\sdformat\1.6"
gzserver

The other should be the client-side of the simulator (client):

c:\opt\ros\foxy\x64\setup.bat
c:\opt\ros\foxy\x64\share\gazebo\setup.bat
set "SDF_PATH=c:\opt\ros\foxy\x64\share\sdformat\1.6"
gzclient

Update paths (WIP)

It should be noted, that the Windows bundle does not set Gazebo model path to your user folder. As of October of 2021, you have to set it by yourself. Concatenate the following variables:

set GAZEBO_RESOURCE_PATH=%GAZEBO_RESOURCE_PATH%;c:\Users\keret\.gazebo\models\
set GAZEBO_MODEL_PATH=%GAZEBO_MODEL_PATH%;c:\Users\keret\.gazebo\models\
set OGRE_RESOURCE_PATH=%OGRE_RESOURCE_PATH%;c:\Users\keret\.gazebo\models\

Gazebo and ROS 2