ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Importing Collada meshes into a Gazebo world

asked 2011-08-24 22:15:07 -0500

AHornung gravatar image

I ran into some trouble when trying to import a Collada mesh file as static world into Gazebo (similar to a previous question).

  1. How can gazebo worlds be distributed into ROS packages? The actual .world file can be put into a package, but in there the mesh is loaded with

    <body:trimesh name="willow_map_body"> <geom:trimesh name="willow_map_geom"> <mesh>meshfile.dae</mesh> (...) </geom:trimesh> </body:trimesh>

    It seems like the actual file (meshfile.dae) needs to be copied manually into simulator_gazebo/gazebo/gazebo/share/gazebo/Media/models/willowgarage.dae or is there a better way?

  2. I ended up with wrongly scaled worlds after exporting a .dae from SketchUp. Could it be that Gazebo requires inches as units for meshes? For example, in gazebo_worlds has a <scale>0.02 0.02 0.02</scale> tag. But shouldn't that instead be <scale>0.0254 0.0254 0.0254</scale>? Otherwise the whole world is slightly too small.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-08-24 22:48:52 -0500

hsu gravatar image

updated 2011-08-25 07:18:07 -0500

For 1), please see this page for resource paths.

For 2), gazebo is unit-less, as long as you pick a consistent set of units for all your models. That said, the PR2 is in meters.

The 0.02 scale for the wg model was arbitrarily chosen, the model was constructed in sketchup and things appeared to be scaled incorrectly without a scale.

Thanks for the update, I've changed scale to 0.0254.

edit flag offensive delete link more


Thanks, 1) works great!
AHornung gravatar image AHornung  ( 2011-08-25 00:00:43 -0500 )edit
Regarding 2): Looks like I've been bitten once more by the Sketchup export bug. I knew the units were wrong (i.e. default to inches with no possibility to change) for VRML, this is apparently also the case for Collada exports. I've also used Sketchup to build a small portion of the Willow map...
AHornung gravatar image AHornung  ( 2011-08-25 00:02:30 -0500 )edit
... but noticed that it's slightly too small when using 0.2 scale. It should really be 0.0254 (which is also in the collada XML header from Sketchup) so that a length of 39.37 "units" (here inch) is 1 meter.
AHornung gravatar image AHornung  ( 2011-08-25 00:05:18 -0500 )edit

answered 2012-01-23 06:39:11 -0500

Penny gravatar image

How did you declare that your scale should be 0.0254?

edit flag offensive delete link more


Question Tools

1 follower


Asked: 2011-08-24 22:15:07 -0500

Seen: 3,625 times

Last updated: Jan 23 '12