Home | Tutorials | Wiki | Issues
Ask Your Question

How to add new materials to gazebo 1.9.5? [closed]

asked 2014-03-19 05:43:17 -0600

FurdekBalint gravatar image

updated 2014-03-19 08:35:04 -0600

Ok, here is the issue: I needed to include some custom-made material in Gazebo 1.9.5, so I added to my bashrc the following line: export GAZEBO_RESOURCE_PATH=~/home/user/user_gazebo_pkg/media:${GAZEBO_RESOURCE_PATH}. Then, when I try to run gazebo, the following error occurs:

Unable to find shader lib. Shader generating will fail.terminate called after throwing an instance of 'Ogre::ItemIdentityException' what(): OGRE EXCEPTION(5:ItemIdentityException): Cannot locate material called 'Gazebo/shadow_caster' in SceneManager::setShadowTextureCasterMaterial at /build/buildd/ogre-1.7.4+dfsg1/OgreMain/src/OgreSceneManager.cpp (line 5833)

Someone else having this issue? Is it forbidden to set GAZEBORESOURCEPATH manually? This is issue is also present in version 2.2!


Ok, sourcing the setup.sh from /usr/share/gazebo-1.9 worked, the Ogre_Exception dissappeared. My initial problem remains, the materials could not be resolved: could not load material...

I set the resource path like I've specified earlier: GAZEBO_RESOURCE_PATH=~/home/user/user_gazebo_pkg/media:${GAZEBO_RESOURCE_PATH}

Inside the media folder i've got materials->scripts and textures folders, where I copied the files I intend to use.


I changed GAZEBO_RESOURCE_PATH=~/home/user/user_gazebo_pkg/media:${GAZEBO_RESOURCE_PATH} to: GAZEBO_RESOURCE_PATH=~/home/user/user_gazebo_pkg:${GAZEBO_RESOURCE_PATH}

and now it works !

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by nkoenig
close date 2014-03-25 14:57:55.412871

1 Answer

Sort by ยป oldest newest most voted

answered 2014-03-19 07:24:08 -0600

updated 2014-03-19 07:26:25 -0600

It seems like gazebo overrides the PATH with default strings if not set. This defaults should be the same as the ones in gazebos setup.sh file (for binary install something like /usr/share/gazebo-1.9/setup.sh)

so you can try to either source the file before you run your command:

source /usr/share/gazebo-1.9/setup.sh

or add the path that's in there to your export statement(something like):

export GAZEBO_RESOURCE_PATH=/usr/share/gazebo-1.9:/usr/share/gazebo_models:/your/path/here

hope this helps...

edit flag offensive delete link more

Question Tools


Asked: 2014-03-19 05:43:17 -0600

Seen: 975 times

Last updated: Mar 19 '14