Home | Tutorials | Wiki | Issues
Ask Your Question
0

sdf model is not showing up correct

asked 2017-07-07 11:36:11 -0600

carolo gravatar image

Hi, I am not able to inserting my sdf model correctly into Gazebo7. If I start my model as a world file including the ground_plane and the sun it is showing up properly.

<?xml version="1.0"?>
<sdf version="1.5">

<!-- environment -->
  <world name="default">
    <include>
      <uri>model://ground_plane</uri>
    </include>
<!-- light -->
    <include>
      <uri>model://sun</uri>
    </include>
<!-- Model -->
    <model name="vehicle">
      .......
     </model>
  </world>
</sdf>

image description

As soon I am trying to start it as a model it will be displayed as boxes. Only changes is the following code:

<?xml version="1.0"?>
<sdf version="1.5">

  <model name="vehicle">
      ......
  </model>
</sdf>

image description

The MODEL_PATH is set correctly, it also displays the correct name of the model-file which typed into the .config file. Maybe somebody can help me???

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-07-07 11:51:48 -0600

Are you trying to open the model file from the command line? Like gazebo model.sdf? That is not supported, only SDF files which have a <world> tag can be opened. Your first example is the correct way to do it.

You can also save the model file, open an empty world in Gazebo, and insert the model afterwards. See this tutorial.

edit flag offensive delete link more

Comments

It is possible for me to open the model from the command line as world "gazebo model.world" but it is not possible for me to open it as stand alone model.sdf when I am trying to insert it and gazebo7 is already running. I am starting up gazebo from the terminal using the command "gazebo". Maybe this is the mistake???

carolo gravatar imagecarolo ( 2017-07-08 05:47:35 -0600 )edit

I solved the problem. The Path of the meshes has not been set correctly.
The following is the correct code:

<geometry>
<mesh>
<uri>/home/MyComputer/ros_ws/src/gazebo_sim/models/vehicle/meshes/DodgeBody.dae</uri>
<scale>2 2 2</scale>
</mesh>
</geometry>

Thanks for your help

carolo gravatar imagecarolo ( 2017-07-08 12:53:14 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-07-07 11:36:11 -0600

Seen: 30 times

Last updated: Jul 07