Home | Tutorials | Wiki | Issues
Ask Your Question

doubt in uploading model .STL file in gazebo

asked 2017-08-14 15:39:21 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi, I made my .stl model file in solidworks with taking center as origin as this is (" Use your 3D modeling software to move each mesh so that it is centered on the origin") written in gazebo make model tutorial. But when i upload these .stl model in gazebo it shows axis of this model to be corner of model. And also i set up material in solidworks during model making so weight should be assigned to it but after uploading model in gazebo it shows mass = 1kg and same inertia for all model files. I m somewhat confused at this point so please help me to get rid of this problem. any help will be appreciated. thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-14 16:08:28 -0600

sloretz gravatar image

STL is supported as one of the mesh shapes in the <geometry> tag. An SDF file is still required.

The mass must be given in an <inertial> tag on a <link>.

There's an example of a model using an stl file in the cube_20k model here. Note that model is usind sdf 1.4. New models should be created with the latest version (currently 1.6).

There is a guided tutorial for creating Velodyne model with a mesh here. It says to create a collada mesh .dae, but the process is exactly the same for an .stl mesh. I recommend going through it.

It sounds like the origin of the .stl mesh is in the corner. I imagine you don't want to redraw your model at the origin in solidworks, so you can use the pose on the <collision> or <visual> to the right place on the <link>.

edit flag offensive delete link more


thanks for reply. can u please clear 2 point -- 1. does that corner side origin of .stl file will create any problem during simulation ?? 2. can i just add inertia calculated from meshlab directly in sdf file ??

mukesh_148 gravatar imagemukesh_148 ( 2017-08-14 16:32:43 -0600 )edit

I don't know of any problems that would be caused by the origin being at the corner. I think as long as the pose is adjusted to put it in the right spot everything should be ok. Yeah you can add the inertia to the sdf file. You may have to [adjust the pose on the inertia tag](http://sdformat.org/spec?ver=1.6&elem=link#inertial_pose) too. Use "View -> Inertias" in the top menu of the gazebo gui to make sure it's right.

sloretz gravatar imagesloretz ( 2017-08-14 16:51:37 -0600 )edit

so now axis of model .stl is corner. I'll calculate inertia w.r.t. corner in meshlab. Now in inrtial tag i will put that inertia tensor. what will be the pose here ??

mukesh_148 gravatar imagemukesh_148 ( 2017-08-15 00:49:34 -0600 )edit

Possibly the opposite of the pose used to position the mesh? I'm not sure, bu visualizing the inertia in the gazebo gui will help a lot in figuring that out.

sloretz gravatar imagesloretz ( 2017-08-16 16:59:57 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-08-14 15:39:21 -0600

Seen: 260 times

Last updated: Aug 14 '17