Home | Tutorials | Wiki | Issues
Ask Your Question
0

[Mac OSX Sierra 10.12.6] Gazebo 9 does not launch after compiling from source

asked 2018-05-10 15:53:38 -0500

drrt gravatar image

updated 2018-05-16 18:25:19 -0500

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

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

edit retag flag offensive close merge delete

Comments

The debuggers shows the full path to the plugin that it is trying to load (RenderSystemGL): does it exist with the .dylib extension?

Jose Luis Rivero gravatar imageJose Luis Rivero ( 2018-05-13 18:05:46 -0500 )edit

Yes, the file RenderSystem_GL.dylib does exist in the directory that the path is pointing to.

drrt gravatar imagedrrt ( 2018-05-13 22:54:40 -0500 )edit

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

drrt gravatar imagedrrt ( 2018-05-14 02:42:04 -0500 )edit

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)

drrt gravatar imagedrrt ( 2018-05-14 02:44:34 -0500 )edit

there might be some clues in `~/.gazebo/ogre.log`

scpeters gravatar imagescpeters ( 2018-05-14 18:12:51 -0500 )edit

I can not reproduce the error on my Sierra system. Probably something bad with the local Ogre installation or other rendering error.

Jose Luis Rivero gravatar imageJose Luis Rivero ( 2018-05-14 18:27:42 -0500 )edit

https://git.io/vp5Mg Here are the contents of ~/.gazebo/ogre.log

drrt gravatar imagedrrt ( 2018-05-15 14:43:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-05-16 18:22:42 -0500

drrt gravatar image

updated 2018-06-02 21:01:50 -0500

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
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-05-10 15:40:26 -0500

Seen: 198 times

Last updated: Jun 02