Gazebo | Ignition | Community
Ask Your Question

including model.sdf in .world Gazebo7

asked 2017-07-03 17:42:39 -0500

carolo gravatar image

Hi, im working since a couple weeks with gazebo and I have some problems including a model.sdf into a .world file.

I am using Gazebo7 and ROS-kinetic. I already sourced the MODEL_PATH at the .bashrc file

export GAZEBO_MODEL_PATH=/home/MyComputer/sim_ws/src/sim_sdf/models/vehicle/:$GAZEBO_MODEL_PATH

and the simulation is running when I start the model-file on its own. After testing I reduced the model-file:

<?xml version="1.0"?>
<sdf version="1.5">
    <model name="vehicle">

To include the model into the world file I use following command:

<?xml version="1.0"?>
<sdf version="1.5">
  <world name="default">

<!-- Model -->
    <model name="vehicle">
        <pose> 0 0 1 0 0 0</pose>

the problem is that gazebo is starting without a model and inside the terminal appears Directory doesn't exist[/home/MyComputer/sim_ws/src/sim_sdf/models/vehicle/model.sdf] So I tried to use


that will take ages and still not work or


what also wont work.....

Hopefully there is somebody who had a similar problem and know what to do. I am totally stucked. Thank you in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-07-03 18:04:33 -0500

sloretz gravatar image

It sounds like /home/MyComputer/sim_ws/src/sim_sdf/models/vehicle/ is a single model. That is, it has just one model.config in it. If so The GAZEBO_MODEL_PATH should be set to the directory that contains it. export GAZEBO_MODEL_PATH=/home/MyComputer/sim_ws/src/sim_sdf/models:$GAZEBO_MODEL_PATH. Then the URI should say just the model name <uri>model://vehicle</uri>.

edit flag offensive delete link more


Thanks for your quick answer. Now the model displays as some boxes and the terminal shows following massage: > libGL error: failed to create drawable

carolo gravatar imagecarolo ( 2017-07-05 06:50:02 -0500 )edit

I solved the problem, this happens when the path of the mesh file is not set correctly.
The following is the correct code:

<scale>2 2 2</scale>

Thanks for your help

carolo gravatar imagecarolo ( 2017-07-08 13:06:52 -0500 )edit

I'd expect `<uri>model://vehicle/meshes/DodgeBody.dae</uri>` to work if the `GAZEBO_MODEL_PATH` is set to the parent directory of `vehicle`. More info about environment variables used by gazebo is here

sloretz gravatar imagesloretz ( 2017-07-10 10:10:03 -0500 )edit
Login/Signup to Answer

Question Tools



Asked: 2017-07-03 17:24:20 -0500

Seen: 3,058 times

Last updated: Jul 05 '17