0
$\begingroup$

Gazebo Answers logo

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>

Originally posted by anonymous on Gazebo Answers with karma: 11 on 2014-12-24

Post score: 1


Original comments

Comment by chapulina on 2015-04-28:
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 ; export GAZEBO_MODEL_PATH=`pwd`:GAZEBO_MODEL_PATH)

Comment by anonymous on 2015-04-29:
Yes, the issue was because of different scaling factor of collisions and visuals.. Thanks a lot!

$\endgroup$

2 Answers 2

0
$\begingroup$

Gazebo Answers logo

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

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


Originally posted by Zheng yo chen with karma: 80 on 2014-12-26

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Gazebo Answers logo

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


Originally posted by chapulina with karma: 7504 on 2014-12-26

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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