Home | Tutorials | Wiki | Issues
Ask Your Question
2

Simulate .stl mesh in Gazebo

asked 2013-03-15 05:14:11 -0600

skhan gravatar image

updated 2013-03-15 05:14:40 -0600

Hello,

I am new at Gazebo/ROS integration tool and I am using ROS groovy with Gazebo 1.3. Yet I am just able to get my hands on sdf xml programming and exported my mesh in gazebo environment.

How should I handle my mesh model to get it running? Should I import part by part?

roslaunch gazeboworlds emptyworld.launch

rosrun gazebo spawnmodel -file model.sdf -gazebo -z 200 -model myrobot

Any help regarding this will be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-03-15 06:31:41 -0600

AndreiHaidu gravatar image

updated 2013-03-15 14:05:18 -0600

Hi,

Here is a tutorial how to import a mesh in gazebo. You could also create an sdf model and import it in the .world file.

<include>
  <uri>model://mesh_model</uri>
  <pose>0 0 1 0 0 0</pose>
</include>

In order to load it save the mesh_model in ~/.gazebo/models folder.

UPDATE

One link with many mesh collisions visuals:

    <model name="my_mesh_one_link">
      <link name="mesh_link">

        <visual name="visual1">
          <geometry>
            <mesh><uri>file://my_mesh1.dae</uri></mesh>
          </geometry>
        </visual>
        <collision name="collision1">
          <geometry>
            <mesh><uri>file://my_mesh1.dae</uri></mesh>
          </geometry>
        </collision>

        <visual name="visual2">
          <geometry>
            <mesh><uri>file://my_mesh2.dae</uri></mesh>
          </geometry>
        </visual>
        <collision name="collision2">
          <geometry>
            <mesh><uri>file://my_mesh2.dae</uri></mesh>
          </geometry>
        </collision>

      </link>
    </model>

For every mesh a different link:

    <model name="my_mesh_many_links">

      <link name="mesh_link1">
        <visual name="visual1">
          <geometry>
            <mesh><uri>file://my_mesh1.dae</uri></mesh>
          </geometry>
        </visual>
        <collision name="collision1">
          <geometry>
            <mesh><uri>file://my_mesh1.dae</uri></mesh>
          </geometry>
        </collision>
      </link>

      <link name="mesh_link2">
        <visual name="visual2">
          <geometry>
            <mesh><uri>file://my_mesh2.dae</uri></mesh>
          </geometry>
        </visual>
        <collision name="collision2">
          <geometry>
            <mesh><uri>file://my_mesh2.dae</uri></mesh>
          </geometry>
        </collision>
      </link>

    </model>

With the later model you can add joints between the links. If you want them to behave statically between them use only one link.

Cheers, Andrei

edit flag offensive delete link more

Comments

@AndreiHaidu Thanks, I am aware of it that how I import it but for simulation I have to import part by part or whole design?

skhan gravatar imageskhan ( 2013-03-15 12:16:39 -0600 )edit

Well, you can either create for every mesh file a link, and then add joints between the links. Or if you want all the pieces in a single link, then you just add more collisions and visuals. I updated the answer with an example. Hope it helps :)

AndreiHaidu gravatar imageAndreiHaidu ( 2013-03-15 13:56:13 -0600 )edit

Thanks I try this approach

skhan gravatar imageskhan ( 2013-03-20 08:43:50 -0600 )edit
IsaacS gravatar imageIsaacS ( 2014-11-15 04:03:34 -0600 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-03-15 05:14:11 -0600

Seen: 5,685 times

Last updated: Mar 15 '13