Gazebo | Ignition | Community
Ask Your Question
1

Importing cad model in gazebo

asked 2014-12-23 23:31:18 -0500

anonymous gravatar image

updated 2015-04-29 20:39:27 -0500

chapulina gravatar image

Hi ,

I want to import cad models in gazebo3 to create the environment. Can anyone suggest how can I do that? Is there any tutorial related to this?I want to import cad model stored as .stl format developed in solidworks tool into gazebo 2.2 version. I used blender to convert it into .dae file. when I import it into gazebo it automatically starts moving without applying any forces or velocity and starts falling down . Then I convert it first to .obj file and then .dae but then also it behaves the same. Can anyone suggest what is wrong? here I am attaching my .dae file . I saved it as .sdf because it wasn't accepting the .dae format while attaching. The attached file is .obj to .dae converted file. Thanks! objTO dae.sdf

Here is the sdf for above mesh.

 <sdf version="1.4">

  <model name="robot">

   <link name="link1">

      <inertial>

        <mass>10000.0</mass>

        <inertia>

          <ixx>140</ixx>

          <ixy>0.0</ixy>

          <iyy>550</iyy>

          <ixz>0.0</ixz>

          <iyz>0.0</iyz>

          <izz>550</izz>

        </inertia>

      </inertial>

      <visual name="visual">

        <!-- rotate mesh to get to X-forward -->

        <pose>0 0 0 0 0 -1.570796</pose>

        <geometry>

          <mesh>

        <scale>20 20 20</scale>

            <uri>model://robot/meshes/untitled3.dae</uri>

          </mesh>

        </geometry>

      </visual>

      <collision name="collision">

    <geometry>

      <mesh>

            <scale>100 100 100</scale>

        <uri>model://robot/meshes/untitled3.dae</uri>

          </mesh>

        </geometry>

      </collision>

    </link>

  </model> 

  </sdf>
edit retag flag offensive close merge delete

Comments

I was able to load your model. Note that the collisions are positioned and scaled differently from the visuals. At first it was falling through like yours, but then I exported the model path and it now collides with the ground. (cd <models directory="">; export GAZEBO\_MODEL\_PATH=\`pwd\`:GAZEBO\_MODEL\_PATH)

chapulina gravatar imagechapulina ( 2015-04-28 12:52:20 -0500 )edit

Yes, the issue was because of different scaling factor of collisions and visuals.. Thanks a lot!

anonymous gravatar imageanonymous ( 2015-04-29 00:54:50 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-12-26 07:46:41 -0500

chapulina gravatar image

Here's a tutorial on how to import 3D meshes into Gazebo.

edit flag offensive delete link more
1

answered 2014-12-25 23:30:21 -0500

Zheng yo chen gravatar image

I usually use blender to convert .stl or .ply to .dae which can be read in sdf file

download link http://www.blender.org/

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-12-23 23:31:18 -0500

Seen: 21,810 times

Last updated: Apr 29 '15