# How to include uri relatively?

I have built a model to be placed within my project, other than placing it in ~/.gazebo/models (then later be used like model://my_model) in my .world file, could I include like the following or similar: (p.s. the following one seems doesn't work)

<include>
<uri>model://$(find my_package)/models/my_model.sdf</uri> </include>  edit retag close merge delete ## 2 Answers Sort by » oldest newest most voted Your .world files are in SDF, and unfortunately SDF doesn't support the kind of substitution you're trying to do. I believe the syntax you're using is supported on ROS launch files. Gazebo will find your model as long as its parent path is listed on the environment variable GAZEBO_MODEL_PATH. So you can place it on a directory other than ~/.gazebo/models and append that path to the environment variable. more ## Comments Hooray! After setting GAZEBO_MODEL_PATH as my model path within /etc/environment, Gazebo did find customized models. Although I expect relative uri's are supported built-in. :-P ( 2017-05-15 23:52:41 -0500 )edit Hey, can you please tell me the steps on how to do that? ( 2020-06-10 02:41:09 -0500 )edit can i use the absolute path in <uri> tag? ( 2020-10-18 21:05:52 -0500 )edit You can make gazebo look in the package directory for models using the package.xml. In the below example, you can put your models into <your/package/directory>/models/ and use them from the world file without copying them into the default gazebo model directory <export> <gazebo_ros gazebo_model_path="${prefix}/models"/>
<gazebo_ros gazebo_media_path="\${prefix}/models"/>
</export>


Here {prefix} is evaluated to the package path

In the world file, now you can do this

<geometry>
<mesh><uri>model://your_mesh.dae</uri></mesh>
</geometry>

more