'[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to Create the Rendering Window' When Running Ignition Gazebo

What‘s the situation

  1. I want to test an empty ignition plugin
  2. I’m using MacOS 10.13.6, running ubuntu 18.04 on docker container
  3. 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:

  1. debugging the server, to test if the ignition server crashed (basically means is there any wrong in your code part)
  2. debugging the gui, to test if the gui is working correctly

More detailed in using ignition GDB:

  1. 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
    5
    root@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/ign
  2. if 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
    16
    Environment 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 to export IGN_GAZEBO_SYSTEM_PLUGIN_PATH=dir_to_find_your_plugin_so

  3. launch gdb using gbd ruby

  4. in gdb shell, running r /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -s world.sdf

  5. 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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(gdb) r /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -s test.world
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/ruby /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -s test.world
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7f68760a8700 (LWP 2016)]
[New Thread 0x7f68627bd700 (LWP 2017)]
[New Thread 0x7f6861fbc700 (LWP 2018)]
[New Thread 0x7f6860f79700 (LWP 2019)]
[New Thread 0x7f6860778700 (LWP 2020)]
[New Thread 0x7f685ff77700 (LWP 2021)]
[New Thread 0x7f685f776700 (LWP 2022)]
[New Thread 0x7f685ef75700 (LWP 2023)]
[New Thread 0x7f685e774700 (LWP 2024)]
[New Thread 0x7f685df73700 (LWP 2025)]
[New Thread 0x7f685d772700 (LWP 2026)]

This is good means that server does not crash.

Then the gui part:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(gdb) r /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -g
Starting program: /usr/bin/ruby /headless/thirdpart_lib/ignition_dome/install/bin/ign gazebo -g
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fa808175700 (LWP 2459)]
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
[New Thread 0x7fa7efb90700 (LWP 2460)]
[New Thread 0x7fa7ee73e700 (LWP 2461)]
[New Thread 0x7fa7dbd99700 (LWP 2462)]
[New Thread 0x7fa7db598700 (LWP 2463)]
[New Thread 0x7fa7dace6700 (LWP 2464)]
[New Thread 0x7fa7d975a700 (LWP 2466)]
[New Thread 0x7fa7d8f59700 (LWP 2467)]
[New Thread 0x7fa7cbfff700 (LWP 2468)]
[New Thread 0x7fa7cb7fe700 (LWP 2469)]
[New Thread 0x7fa7caffd700 (LWP 2470)]
[New Thread 0x7fa7ca7fc700 (LWP 2471)]
[New Thread 0x7fa7abbe1700 (LWP 2472)]
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:732] Unable to create the rendering window
[GUI] [Err] [Ogre2RenderEngine.cc:739] Unable to create the rendering window
Thread 14 "ignition::gazeb" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fa7abbe1700 (LWP 2472)]
0x00007fa7a93f9940 in Ogre::ConstBufferPool::_changeRenderSystem(Ogre::RenderSystem*) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.2.1.0

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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<gui fullscreen="0">

<!-- 3D scene -->
<plugin filename="GzScene3D" name="3D View">
<ignition-gui>
<title>3D View</title>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</ignition-gui>

<engine>ogre</engine>
<scene>scene</scene>
<ambient_light>1 1 1</ambient_light>
<background_color>0.8 0.8 0.8</background_color>
<camera_pose>10 -20 10 0 0.6 1.57</camera_pose>
</plugin>
</gui>

by deafult, the configuration is <engine>ogre2</engine>.

You can test the following world running on Ogre1.

1
ign gazebo -v 3 lights.sdf