What‘s the situation
- I want to test an empty ignition plugin
- I’m using MacOS 10.13.6, running ubuntu 18.04 on docker container
- When launching ign gazebo, the ignition gui always crashed. showing:
1 | [GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window |
GDB debug
The tutorial is here: https://ignitionrobotics.org/api/gazebo/3.0/debugging.html
GDB debug ignition contains 2 parts:
- debugging the server, to test if the ignition server crashed (basically means is there any wrong in your code part)
- debugging the gui, to test if the gui is working correctly
More detailed in using ignition GDB:
find the ign executable:
which ign
should not be/usr/bin/ign
, it should point to somewhere related to compiled package. To do so, you can just source your package environment settings. for example:1
2
3
4
5root@5e3e3e686974:~/dev_ws# which ign
/usr/bin/ign
root@5e3e3e686974:~/dev_ws# source ./install/setup.bash
root@5e3e3e686974:~/dev_ws# which ign
/headless/thirdpart_lib/ignition_dome/install/bin/ignif your sdf file contains plugin, then you should configure the environment variables in this terminal. check
ign gazebo --help
:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16Environment variables:
IGN_GAZEBO_RESOURCE_PATH Colon separated paths used to locate
resources. Can be useful to find an SDF file.
IGN_GAZEBO_SYSTEM_PLUGIN_PATH Colon separated paths used to
locate system plugins.
IGN_GUI_PLUGIN_PATH Colon separated paths used to locate GUI
plugins.
IGN_GAZEBO_NETWORK_ROLE Participant role used in a distributed
simulation environment. Role is one of [PRIMARY, SECONDARY]. This is
deprecated in ign-gazebo2. Please use --network-role instead.
IGN_GAZEBO_NETWORK_SECONDARIES Number of secondary participants
expected to join a distributed simulation environment. (Primary only)The most important variable is
IGN_GAZEBO_SYSTEM_PLUGIN_PATH
. So you might need toexport IGN_GAZEBO_SYSTEM_PLUGIN_PATH=dir_to_find_your_plugin_so
launch gdb using
gbd ruby
in gdb shell, running
r /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -s world.sdf
Use GDB as normal.
The gui gdb is similar, the only thing is you should open a new terminal to run gdb.
GUI dgb is run in gdb shell as r /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -g
The GDB results show that :
1 | (gdb) r /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -s test.world |
This is good means that server does not crash.
Then the gui part:
1 | (gdb) r /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -g |
So now, you find the problem is in gui unable to create render window.
Solution in here
Troubleshooting part https://ignitionrobotics.org/docs/citadel/install_ubuntu_src#unable-to-create-the-rendering-window
Means that you’re using an old OpenGL version. ignition gazebo uses ogre2 rendering engine by default, which requires an OpenGL version higher than 3.3.
But you can set the engine back to ogre in your world.sdf in tag <gui>
as:
1 | <gui fullscreen="0"> |
by deafult, the configuration is <engine>ogre2</engine>
.
You can test the following world running on Ogre1.
1 | ign gazebo -v 3 lights.sdf |