Ask Your Question
0

URDF tags for creating objects involving curved surfaces and body parts

asked 2012-09-03 00:25:18 -0500

updated 2012-09-03 23:28:38 -0500

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 ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-09-03 06:05:38 -0500

Adolfo Rodriguez T gravatar image

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.

edit flag offensive delete link more

Comments

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...

aknirala gravatar imageaknirala ( 2012-09-03 22:55:42 -0500 )edit

"[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

aknirala gravatar imageaknirala ( 2012-09-03 22:58:11 -0500 )edit

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).

Adolfo Rodriguez T gravatar imageAdolfo Rodriguez T ( 2012-09-04 01:41:10 -0500 )edit

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?

aknirala gravatar imageaknirala ( 2012-09-04 02:26:18 -0500 )edit

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.

Adolfo Rodriguez T gravatar imageAdolfo Rodriguez T ( 2012-09-04 02:47:38 -0500 )edit

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.

aknirala gravatar imageaknirala ( 2012-09-04 03:33:10 -0500 )edit

also I'll get to know some handy tags from ur file. :-)

aknirala gravatar imageaknirala ( 2012-09-04 03:34:43 -0500 )edit

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.

Adolfo Rodriguez T gravatar imageAdolfo Rodriguez T ( 2012-09-04 03:41:38 -0500 )edit
1

answered 2012-09-03 01:37:18 -0500

dornhege gravatar image

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.

edit flag offensive delete link more

Comments

Thanks, Is there a tool etc to visualize and create desired mesh. Can you point me to some links to do the same..

aknirala gravatar imageaknirala ( 2012-09-03 02:24:24 -0500 )edit

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.

dornhege gravatar imagedornhege ( 2012-09-03 02:27:24 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2012-09-03 00:25:18 -0500

Seen: 1,080 times

Last updated: Sep 03 '12