Ask Your Question
0

Unable to import mesh file

asked 2012-01-26 00:19:02 -0500

Penny gravatar image

updated 2012-01-26 01:44:40 -0500

I have created a launch file:

<launch>

  <!-- start gazebo with an simple world -->
  <param name="/use_sim_time" value="true" />

  <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/pool.world" respawn="false" output="screen"/>

</launch>

My .world file contains the below about my mesh file:

<model:physical name="pool">
   <xyz>0.0 0.0 0.9</xyz>
   <rpy>0 0 0</rpy>
   <static>true</static>
   <body:trimesh name="pool">
   <geom:trimesh name ="pool_geom">
     <scale>0.0254 0.0254 0.0254</scale>
     <mesh>finalpool.dae</mesh>
     <visual>
      <scale>0.0254 0.0254 0.0254</scale>
      <mesh>finalpool.dae</mesh>
     </visual>
   </geom:trimesh>
   </body:trimesh>
  </model:physical>

and I used the command line:

roslaunch gazebo_worlds pool_world.launch

but I get this error:

Error: [/tmp/buildd/ros-electric-simulator-gazebo-1.4.9/debian/ros-electric-simulator-gazebo/opt/ros/electric/stacks/simulator_gazebo/gazebo/build/gazebo/server/AssimpLoader.cc:37]
Importer Error:Collada: File came out empty. Something is wrong here./tmp/buildd/ros-electric-simulator-gazebo-1.4.9/debian/ros-electric-simulator-gazebo/opt/ros/electric/stacks/simulator_gazebo/gazebo/build/gazebo/server/AssimpLoader.cc:38 : Exception: Unable to import mesh file[/opt/ros/electric/stacks/simulator_gazebo/gazebo_worlds/Media/models/finalpool.dae] using assimp

Error: [/tmp/buildd/ros-electric-simulator-gazebo-1.4.9/debian/ros-electric-simulator-gazebo/opt/ros/electric/stacks/simulator_gazebo/gazebo/build/gazebo/server/MeshManager.cc:131]
Error loading mesh[/opt/ros/electric/stacks/simulator_gazebo/gazebo_worlds/Media/models/finalpool.dae]
Error: [/tmp/buildd/ros-electric-simulator-gazebo-1.4.9/debian/ros-electric-simulator-gazebo/opt/ros/electric/stacks/simulator_gazebo/gazebo/build/gazebo/server/MeshManager.cc:132]
/tmp/buildd/ros-electric-simulator-gazebo-1.4.9/debian/ros-electric-simulator-gazebo/opt/ros/electric/stacks/simulator_gazebo/gazebo/build/gazebo/server/AssimpLoader.cc:38 : Exception: Unable to import mesh file[/opt/ros/electric/stacks/simulator_gazebo/gazebo_worlds/Media/models/finalpool.dae] using assimp

How can I fix this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-03-15 07:10:28 -0500

scribbleink gravatar image

Hi Penny, Stefan,

I realize this question is a few months old, but I've recently been meddling with DAE imports into Gazebo as well. First off, it looks like the Open Asset Import Library (unfortunately named assimp) is used for importing Collada DAE files. You could run assimp on command line with your file to make sure that it works in the first place. If not, I suggest trying a different format if you can change it, e.g. from DAE to Ogre XML mesh.

Some notes on Collada/Assimp can be found here and here.

Proceeding from there, this link from the Gazebo manual helped me.

Specifically, I had a model with a multiple mesh hierarchy, e.g. roof separate from walls, each with a separate texture map. This is unfortunately not supported in Gazebo at this moment, as mentioned in the manual. The way I got this to work was complicated, but if you're interested and it helps anyone else, here it is:

  1. Import the DAE file into Blender (I'm using 2.49b).
  2. Remove the texture maps, select all meshes and join them (Ctrl+J).
  3. Create new texture map (UV mode).
  4. Unwrap the new joined mesh to get the right coordinates on the texture map.
  5. Manually (and magically!) splice the different texture bitmaps to the right locations (re-texturing).
  6. Use the new bitmap you created in Step 5 as the texture input for the material shader loaded into Gazebo.

Although I got this to work, it is unfortunately too complicated to do for models that are not simple, so I do hope future versions will do away with the 'single mesh' requirement, or, I hope there might be a Blender plugin that does the unwrapping automa[t|g]ically!

Best,

Nikhil

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-01-26 00:19:02 -0500

Seen: 1,894 times

Last updated: Mar 15 '12