How to add new materials to gazebo 1.9.5?
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!
============================UPDATE==============================
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.
===============================SOLVED=========================
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 !
Asked by FurdekBalint on 2014-03-19 05:43:17 UTC
Answers
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...
Asked by evilBiber on 2014-03-19 07:24:08 UTC
Comments