Home | Tutorials | Wiki | Issues
Ask Your Question
1

Using_A_URDF_In_Gazebo: package:// URIs not described

asked 2014-06-17 07:32:20 -0600

peci1 gravatar image

updated 2014-06-17 07:33:28 -0600

When I read through the tutorials Using A URDF In Gazebo and Using roslaunch files to Spawn Models I have the impression that it is possible to run Gazebo with ROS without using Gazebo's model database.

To explain, I need to work with some models from ROS using Gazebo. In my view, adding the models to a local database doesn't make sense, because the users of my code just want to git clone and catkin_make and that's all.

So I searched for a way to specify paths to mesh files from my URDF relatively to the package they are contained in. Using the file:// protocol doesn't seem to be a good option, since its resolution is dependent on the working directory.

Somewhere I've found that a package:// protocol can be used, and it actually works in my models. However, there doesn't seem to be any documentation for that. Do you know of docs page that would explain the details and prerequisites for using that?

I've thought about another way to use my models without the need to install them locally. I could just add the package path to GAZEBO_RESOURCE_PATH. But where to do this? Should I use <env> tag in the launch file? Do you have any experience with that?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-06-17 14:19:26 -0600

Hi,

you can use the export statement in your package.xml to pass this variables to gazebo_ros

 ...   
<export>                            

    <gazebo_ros                                                                 
    gazebo_media_path="${prefix}:/another/path"

    gazebo_plugin_path="${prefix}/lib"    

    gazebo_model_path="${prefix}/../your_models"           
    gazebo_resource_path="${prefix}:/path/to/your/resources"/>                    
</export>
...

This works fine for out projects

This is mentioned in one of the last ros integration tutorials but not really explained...

ros_plugins

edit flag offensive delete link more

Comments

@evilBiber thanks for your tip! Where did you get to know about that? And how does it work? The plugin tag only references the shared library file, which IMO doesn't have any link to the package.xml of its original package. Or does it?

peci1 gravatar imagepeci1 ( 2014-06-24 10:24:39 -0600 )edit

What is the value of ${prefix} here? @evilBiber

winston gravatar imagewinston ( 2015-03-13 23:01:30 -0600 )edit
2

${prefix} is always the path of the package.xml itself/

evilBiber gravatar imageevilBiber ( 2015-06-10 02:45:48 -0600 )edit

This doesn't work for me, because I still have to manually set the GAZEBO_MODEL_PATH in my bash file. Do I have to add something special to the CMake file?

Lyndwyrm gravatar imageLyndwyrm ( 2016-10-18 00:35:49 -0600 )edit

check that your package.xml file has: <run_depend>gazebo_ros</run_depend>

lime-robotics gravatar imagelime-robotics ( 2017-09-06 16:33:10 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2014-06-17 07:32:20 -0600

Seen: 1,722 times

Last updated: Jun 17 '14