0
$\begingroup$

Gazebo Answers logo

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);

image description http://answers.gazebosim.org/upfiles/15259855454401078.png

I am not sure how to proceed from here. Any help would be greatly appreciated.


Originally posted by drrt on Gazebo Answers with karma: 21 on 2018-05-10

Post score: 0


Original comments

Comment by Jose Luis Rivero on 2018-05-13:
The debuggers shows the full path to the plugin that it is trying to load (RenderSystemGL): does it exist with the .dylib extension?

Comment by drrt on 2018-05-13:
Yes, the file RenderSystem_GL.dylib does exist in the directory that the path is pointing to.

Comment by drrt on 2018-05-14:
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()

Comment by drrt on 2018-05-14:
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)

Comment by scpeters on 2018-05-14:
there might be some clues in ~/.gazebo/ogre.log

Comment by Jose Luis Rivero on 2018-05-14:
I can not reproduce the error on my Sierra system. Probably something bad with the local Ogre installation or other rendering error.

Comment by drrt on 2018-05-15:
https://git.io/vp5Mg Here are the contents of ~/.gazebo/ogre.log

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

Finally, it works! So I ended up restarting the computer and then doing a fresh clone of the gazebo repo, but this time to my home directory. Everything else was the same and now everything works great!

Here are the set of commands that worked for me (the first three steps are only necessary if you don't already have Homebrew, XQuartz, and/or mercurial installed).

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/xquartz
brew install mercurial
brew tap osrf/simulation
brew install gazebo9 --only-dependencies

hg clone https://bitbucket.org/osrf/gazebo ~/gazebo
mkdir -p ~/gazebo/build
cd ~/gazebo/build
hg up gazebo9

export PATH="/usr/local/opt/qt/lib/cmake/Qt5:$PATH"
cmake -DCMAKE_BUILD_TYPE=Debug ../

export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/gettext/lib
make -j4
sudo make install

(might need to reboot computer before running Gazebo for the first time)

source ~/gazebo/build/setup.sh
gazebo --verbose

Originally posted by drrt with karma: 21 on 2018-05-16

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.