0
$\begingroup$

Rosanswers logo

Hi,

I am trying to create objects for indoor environment. (Though I am hoping that these objects must be already created by someone, I asked that at: http://answers.ros.org/question/42435/pointers-to-office-and-home-environment-in-gazebo/)

I created a chair in urdf. The chair looks like:-

chair

The back-support of the chair has three cylinders and all are straight. However I need them to be a bit circular. How to achieve that?

I couldn't find any useful tags at : http://www.ros.org/wiki/urdf/XML

Where can I find all the tags interpreted by urdf.

I also saw the urdf of door from http://ros.org/wiki/pr2_simulator/Tutorials/PR2OpenDoor,

It contains a door.urdf, which has tags like:-

  <gazebo reference="door_link">
    <latchJoint>handle_joint</latchJoint>
    <latchAngle>-1.57</latchAngle>
    <doorClosedAngle>0.0</doorClosedAngle>
    <latchKp>200.0</latchKp>
    <latchKd>0.0</latchKd>
    <latchFMax>1000.0</latchFMax>
  </gazebo>

I guess these tags (latchAngle, doorClosedAngle) are defining the two states of the door (open/close). Are these tags custom made (I didn't went through the entire code as door opening is not supported after diamondback) or are standard?

Any pointers/suggestions/links/comment is greatly appreciated.

Also is there any tool which I can use to create object quickly?



Edit 1 @Adolfo Rodriguez T:-
I am not able to launch the .dae file :-(, (it seems it need further processing, as .dae files in gazebo_world are getting launched). What am I doing wrong? If I am able to spawn and use these models it will save a lot of time for me.
I downloaded chair from link provided by you (.zip version). It contained :-

  1. Nelson_Swag_Leg_Chair/models/Nelson_Swag_Leg_Chair.dae
  2. Nelson_Swag_Leg_Chair/doc.kml
  3. Nelson_Swag_Leg_Chair/textures.txt (its 0 bytes)
(I have replaced spaces with _ in file and folder names, hope thats not an issue).

My .model file (which does not work at all):-

<model name="Nelson_Swag_Leg_Chair" static="true">
    <link name="Nelson_Swag_Leg_Chair">
        <origin pose="0 0 0 0 0 0"/>
        <collision>
            <geometry>
                <mesh filename="/home/nirala/ros_workspace/myWorld/world/object/Nelson_Swag_Leg_Chair/models/Nelson_Swag_Leg_Chair.dae" scale="1 1 1"/>
            </geometry>
        </collision>
        <visual>
            <geometry>
                <mesh filename="package://myWorld/world/object/Nelson_Swag_Leg_Chair/models/Nelson_Swag_Leg_Chair.dae" scale="1 1 1"/>
            </geometry>
        </visual>
    </link>
</model>

and launch file as:-

<launch>
  <param name="Nelson_Swag_Leg_Chair_p" textfile="$(find myWorld)/world/object/Nelson_Swag_Leg_Chair/Nelson_Swag_Leg_Chair.model" />
  <node name="Nelson_Swag_Leg_Chair" pkg="gazebo" type="spawn_model" args="-gazebo -param Nelson_Swag_Leg_Chair_p -z 0.1 -y 2 x -x 2 -model Nelson_Swag_Leg_Chair" respawn="false" output="screen"/>
</launch>

But this gave me error as:-

[ERROR] [1346749562.693001448, 982.362000000]: GazeboROSNode SpawnModel Failure: input model_xml not Gazebo XML, or cannot be converted to Gazebo XML

Then I tried to make an urdf file as:-

<?xml version="1.0"?>
<robot name="Nelson_Swag_Leg_Chair_U">
  <link name="Nelson_Swag_Leg_Chair_n">
    <visual>
      <origin rpy="0 0 0" xyz="0.09137 0.00495 1"/>
      <geometry>
        <mesh filename="package://myWorld/world/object/Nelson_Swag_Leg_Chair/models/Nelson_Swag_Leg_Chair.dae" scale = ".1 .1 .1"/>
      </geometry>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://myWorld/world/object/Nelson_Swag_Leg_Chair/models/Nelson_Swag_Leg_Chair.dae" scale = ".1 .1 .1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0.09137 0.00495 1"/>
    </collision>
    <inertial>
      <mass value="1"/>
      <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
  </link>

</robot>

and I tried to launch it as :-

rosrun gazebo spawn_model -file Nelson_Swag_Leg_Chair.urdf -urdf  -model mera_mode

It launched sth but not the chair, the image (selected in gazebo is): image description

If possible kindly provide me a sample file .model/.urdf and .launch for any model which you have used.

Thanks.


Originally posted by aknirala on ROS Answers with karma: 339 on 2012-09-03

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

If you're interested in populating a scene with indoor objects, and not modelling specific (eg. chair) instances, you can check out Trimble's 3D warehouse. Some models are available directly in Collada format, which both Gazebo and Rviz support. Example chair.


Originally posted by Adolfo Rodriguez T with karma: 3907 on 2012-09-03

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by aknirala on 2012-09-03:
Thanks a lot for this link, this is what I need but I am unable to spawn the model. I have tried top make .model file as shown at : http://answers.ros.org/question/42529/how-to-import-collada-dae-files-into-gazebo-rosfuerte/ but this gives : [ERROR] [1346743638.585663220, 2892.569000000]: GazeboR...

Comment by aknirala on 2012-09-03:
"[ERROR] [1346743638.585663220, 2892.569000000]: GazeboROSNode SpawnModel Failure: input model_xml not Gazebo XML, or cannot be converted to Gazebo XML", when I use an URDF and spawn as rosrun gazebo spawn_model -file Nelson_Swag_Leg_Chair.urdf -urdf -model my_model I see sth else. Editing Q 4 dtls

Comment by Adolfo Rodriguez T on 2012-09-04:
You seem to be using the Electric version of Gazebo. Please try with Fuerte's Gazebo, which contains a fix for rendering Collada assets with quads. Alternatively, to stick with Electric, re-export the file to Collada using triangle meshes instead of quads (eg. using Meshlab).

Comment by aknirala on 2012-09-04:
I am new to MeshLab, how exactly could I re-export? After importing mesh in Filters, in Remeshing...there is option of Tri to Qu.. and not otherwise (even for pr2_description/meshes which I can spawn). And if I try Tri to Qua... it crashes.. It seems I need to switch to Furete. R thr other tools?

Comment by Adolfo Rodriguez T on 2012-09-04:
Try just opening the asset and save as Collada. Meshlab will regenerate the dae file from its internal geometric representation. I have v1.2.2, which is rather old, but does the trick.

Comment by aknirala on 2012-09-04:
It worked, but two things 1) Its still giving error if I use .model file and 2) from .urdf file the chair appears but keeps on swinging. Do I need to add another tag etc to stop it? Other spawned objects remain stationary. I request you to share your urdf/model file if there is such a case. Thanks.

Comment by aknirala on 2012-09-04:
also I'll get to know some handy tags from ur file. :-)

Comment by Adolfo Rodriguez T on 2012-09-04:
The chair is swinging most probably because the origin of your inertial frame is unspecified (hence at 0, 0, 0). Try giving it more realistic values. Of lesser importance, you can then tune the mass and inertia tensor to also have more realistic values. Otherwise your URDF seems OK.

Comment by aknirala on 2012-09-04:
Yes the issue with inertia, I can see it now. Again a silly question, but I couldn't find much details about it in urdf tutorial. How to infer this tag? Can meshLab tell me about its value?

Comment by Adolfo Rodriguez T on 2012-09-04:
In the future, please refer not only to the tutorials but also to the actual package doc (urdf) in particular that of the link element. You can define the inertia using a simplified model.

Comment by aknirala on 2012-09-06:
I got it now, the above links didn't helped much as I was not familiar with inertial tensor and hence origin. This helped me : http://techhouse.brown.edu/~dmorris/projects/tutorials/inertia.tensor.summary.pdf to make it crystal clear. Thanks a lot for all the help, these obj's saved a lot of my time

$\endgroup$
0
$\begingroup$

Rosanswers logo

You'll need to use a custom mesh and the mesh tag. I think those specific tags like cylinder, box are only there to get something simple running quick, but not for actually building complex geometry.


Originally posted by dornhege with karma: 31395 on 2012-09-03

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by aknirala on 2012-09-03:
Thanks, Is there a tool etc to visualize and create desired mesh. Can you point me to some links to do the same..

Comment by dornhege on 2012-09-03:
A quick test for a URDF display is: roslaunch urdf_tutorial display.launch model:=myurdf.urdf For modelling, you can use anything that outputs STL or collada, like blender.

$\endgroup$

Your Answer

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