0
$\begingroup$

Rosanswers logo

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?


Originally posted by Penny on ROS Answers with karma: 41 on 2012-01-26

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by scribbleink with karma: 116 on 2012-03-15

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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