0
$\begingroup$

Gazebo Answers logo

Hello, having a problem where the meshes which i'm importing to my URDF file are absolutely huge. The dimensions are correct in solidworks (around 400mm cube). I tried changing the units of the part back to meters as i was working in mm and this had no effect. Any idea what i'm doing wrong?


Originally posted by adam896 on Gazebo Answers with karma: 3 on 2015-03-19

Post score: 0


Original comments

Comment by chapulina on 2015-03-19:
It would help if you're able to share your STL and URDF files. You can just update the question.

Comment by adam896 on 2015-03-23:
I dont really know what was causing this, maybe the fact that the solidworks model was developed in mm rather than m, i ended up just using a scaling tag and setting the three parameters to 0.001 and it imported fine

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

It seems that there isn't a way to specify units in STL files. So whatever unit you use will be treated as meters by Gazebo. That's why your 400 mm cube came out as a 400 m cube.

Your solution seems to be the easiest one, to specify a scaling factor for the mesh on SDF, from mm to m for example:

<mesh>
  <uri>model://model_name/meshes/your_mesh.stl</uri>
  <scale>0.001 0.001 0.001</scale>
</mesh>

An alternative would be to rescale the mesh with an external editor.


Originally posted by chapulina with karma: 7504 on 2015-03-23

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by javi.galarza.s on 2020-02-17:
That worked for me. just remember to write it down under every part of the world code. Thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.