Skip to content

Gazebo setup

Jarosław Karwowski edited this page Sep 10, 2023 · 10 revisions

Extra models - 3DGEMS

Download model archives into ~/.gazebo directory:

cd ~/.gazebo
mkdir models_3dgems
cd models_3dgems
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/decoration.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/earthquake.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/electronics.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/food.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/furniture.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/kitchen.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/miscellaneous.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/shapes.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/stationery.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/tools.tar.gz
wget https://data.nvision2.eecs.yorku.ca/3DGEMS/data/worlds.tar.gz

Unpack these archives:

tar -xvzf decoration.tar.gz --strip-components 1
tar -xvzf earthquake.tar.gz --strip-components 1
tar -xvzf electronics.tar.gz --strip-components 1
tar -xvzf food.tar.gz --strip-components 1
tar -xvzf furniture.tar.gz --strip-components 1
tar -xvzf kitchen.tar.gz --strip-components 1
tar -xvzf miscellaneous.tar.gz --strip-components 1
tar -xvzf shapes.tar.gz --strip-components 1
tar -xvzf stationery.tar.gz --strip-components 1
tar -xvzf tools.tar.gz --strip-components 1
tar -xvzf worlds.tar.gz --strip-components 1

Delete unnecessary archives:

rm decoration.tar.gz
rm earthquake.tar.gz
rm electronics.tar.gz
rm food.tar.gz
rm furniture.tar.gz
rm kitchen.tar.gz
rm miscellaneous.tar.gz
rm shapes.tar.gz
rm stationery.tar.gz
rm tools.tar.gz
rm worlds.tar.gz

Modify Gazebo paths setup:

sudo gedit /usr/share/gazebo-9/setup.sh

Extend model directories with ~/.gazebo/models_3dgems:

export GAZEBO_MODEL_PATH=/usr/share/gazebo-9/models:~/.gazebo/models_3dgems:${GAZEBO_MODEL_PATH}

Downloading Gazebo models manually

  1. Download osrf/gazebo_models into ~/.gazebo/.

    git clone https://github.com/osrf/gazebo_models ~/.gazebo/models_gazebo
  2. Extend model directories (GAZEBO_MODEL_PATH env. variable) with ~/.gazebo/models_gazebo (similarly as in the section above).

Error connecting to Gazebo model database

There may be some issues with Gazebo 9.0.0 on Ubuntu 18. If you see this kind of output in the gazebo console:

[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.1.101
[Msg] Publicized address: 192.168.1.101
[Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
[Wrn] [ModelDatabase.cc:340] Getting models from[http://gazebosim.org/models/]. This may take a few seconds.
[Err] [ModelDatabase.cc:390] Unable to parse model.config for model[http://gazebosim.org/models/bin_4_dropping_task]
[Err] [ModelDatabase.cc:390] Unable to parse model.config for model[http://gazebosim.org/models/bin_4_dropping_task]

check gazebo#2934 issue page for a workaround.

In a nutshell:

  1. Clone gazebo_models from osrf:
cd ~/.gazebo
git clone https://github.com/osrf/gazebo_models models_gazebo/
  1. Modify Gazebo paths setup:
sudo gedit /usr/share/gazebo-9/setup.sh

Change GAZEBO_MODEL_DATABASE_URI env variable to:

export GAZEBO_MODEL_DATABASE_URI="" # http://gazebosim.org/models

Extend model directories with ~/.gazebo/models_gazebo, e.g.:

export GAZEBO_MODEL_PATH=/usr/share/gazebo-9/models:~/.gazebo/models_gazebo:${GAZEBO_MODEL_PATH}

ignition config

If you encounter api.ignitionfuel.org error you may need to modify servers/url in ~/.ignition/fuel/config.yaml to:

url: fuel.ignitionrobotics.org

Installation summary

If you applied Gazebo "patch" and installed 3DGems models, you'll end up with /usr/share/gazebo-9/setup.sh with GAZEBO_MODEL_PATH entry:

export GAZEBO_MODEL_PATH=/usr/share/gazebo-9/models:~/.gazebo/models_gazebo:~/.gazebo/models_3dgems:${GAZEBO_MODEL_PATH}

Remember that you must source Gazebo setup before each Gazebo run:

source /usr/share/gazebo-9/setup.sh

Actor sensor visualization

To get rid of LiDARs visualization in Gazebo, one should apply this kind of diff (example for living_room world`):

diff --git a/hubero_bringup_gazebo_ros/worlds/living_room.world b/hubero_bringup_gazebo_ros/worlds/living_room.world
index 9ad3600..2088798 100644
--- a/hubero_bringup_gazebo_ros/worlds/living_room.world
+++ b/hubero_bringup_gazebo_ros/worlds/living_room.world
@@ -7993,7 +7993,7 @@
         <sensor type="gpu_ray" name="laser">
         <!-- CS info: x - side axis, y - height, z - person's nose heading -->
         <pose>0 -0.8 0.55 0 -1.57 -1.57</pose>
-        <visualize>true</visualize>
+        <visualize>false</visualize>
         <update_rate>10</update_rate>
         <ray>
           <scan>
@@ -8096,7 +8096,7 @@
         <sensor type="gpu_ray" name="laser">
         <!-- CS info: x - side axis, y - height, z - person's nose heading -->
         <pose>0 -0.8 0.55 0 -1.57 -1.57</pose>
-        <visualize>true</visualize>
+        <visualize>false</visualize>
         <update_rate>10</update_rate>
         <ray>
           <scan>