[Mac OSX Sierra 10.12.6] Gazebo 9 does not launch after compiling from source
I am trying to get Gazebo to run on Mac OS X Sierra. Gazebo works great when I install everything using homebrew, but I can't get it to work with a build from source. The compilation and install seem to complete successfully, but nothing happens when I run the gazebo executable from the terminal. Here are the steps I've taken:
brew install caskroom/cask/xquartz
brew tap osrf/simulation
brew install gazebo9 --only-dependencies
brew install mercurial
hg clone https://bitbucket.org/osrf/gazebo /tmp/gazebo
cd /tmp/gazebo
mkdir build
cd build
hg up gazebo9
cmake -DCMAKE_BUILD_TYPE=Debug ../
make -j4
make install
source /usr/local/share/gazebo/setup.sh
gazebo --verbose
Which produces the following output:
Gazebo multi-robot simulator, version 9.0.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
Gazebo multi-robot simulator, version 9.0.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
[Msg] Waiting for master.
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.10.195.121
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.10.
but then nothing happens... I also tried starting the Gazebo server
gzserver
but it just segfaults... So I ran the debugger and it halts on line 442 of the RenderEngine.cc file where it tries to load an OGRE plugin.
this->dataPtr->root->loadPlugin(*piter+extension);
I am not sure how to proceed from here. Any help would be greatly appreciated.
The debuggers shows the full path to the plugin that it is trying to load (RenderSystemGL): does it exist with the .dylib extension?
Yes, the file RenderSystem_GL.dylib does exist in the directory that the path is pointing to.
Since the Exception shown is EXC_BAD_ACCESS and the address=0x0, then I figured a NULL pointer is getting dereferenced somewhere. I fixed the segfault by modifying the source code a little at the end of function void RenderEngine::Load() https://bitbucket.org/osrf/gazebo/src/a6e1319eaf1af48c4bdec25bcc1268cb1d6f366e/gazebo/rendering/RenderEngine.cc?at=gazebo9&fileviewer=file-view-default#RenderEngine.cc-135 so that this->dataPtr->root->initialise(false); gets called before this->LoadPlugins()
It does not segfault anymore, but now when I run either gazebo or gzerver with the --verbose flag it shows the following error: [Err] [server_main.cc:54] Ogre Error:OGRE EXCEPTION(1:InvalidStateException): Cannot initialise - no render system has been selected. in Root::initialise at /tmp/ogre1.9-20180417-89133-1ftu64a/sinbad-ogre-108ab0bcc696/OgreMain/src/OgreRoot.cpp (line 650)
there might be some clues in `~/.gazebo/ogre.log`
I can not reproduce the error on my Sierra system. Probably something bad with the local Ogre installation or other rendering error.
https://git.io/vp5Mg Here are the contents of ~/.gazebo/ogre.log