ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

In URDF how do I get more than one geomtry element in a link?

asked 2013-02-21 07:46:45 -0500

TommyP gravatar image

I would like to build a simple robot model in urdf with just visualization and display it in rviz. I just have one tf frame for the body (it is a quad rotor) so how can I use the same frame for more than on geometry element?

Or is it possible to take a 3D model and just use that?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-02-21 08:40:10 -0500

David Lu gravatar image

Short answer is that you currently can't do exactly what you're saying.

The easiest way to get around it is to create a second link with an appropriate offset, connected with a fixed joint.

This does create an extra frame which will need to be published. This is most often handled with robot_state_publisher.

edit flag offensive delete link more

Comments

I suppose I will get one extra frame per geomtry I want to have. I was afraid that would give possible delays but maybe it will work. I will test it. SO if I used tix joints I can use robot_state_publisher. I assume I could also just have no joints and just publish the frames from my program.

TommyP gravatar image TommyP  ( 2013-02-21 09:01:54 -0500 )edit

robot_state_publisher is a little wonky, I think, in that it will only publish tfs when it gets joint state messages, so you may also need joint_state_publisher.

David Lu gravatar image David Lu  ( 2013-02-21 09:21:40 -0500 )edit

Joint state is not needed if you only have static links. It is necessary with dynamic links.

Claudio gravatar image Claudio  ( 2013-02-21 11:43:05 -0500 )edit
0

answered 2013-02-21 11:42:03 -0500

Claudio gravatar image

Following is the full code of the first version of the urdf of the robots I'm working on.

<?xml version="1.0"?>
<robot name="Saetta">
  <link name="base_link">
  </link>

  <link name="body">
    <visual>
      <geometry>
        <box size="0.195 0.145 0.055"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0.032"/>
      <material name="grey">
        <color rgba="0.5 0.5 0.5 1"/>
      </material>
    </visual>
  </link>

  <link name="cover">
    <visual>
      <geometry>
        <box size="0.195 0.145 0.02"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0.069"/>
      <material name="dark_transparent_grey">
        <color rgba="0.2 0.2 0.2 0.5"/>
      </material>
    </visual>
  </link>


  <link name="right_wheel">
    <visual>
      <geometry>
        <cylinder radius="0.032" length=".007"/>
      </geometry>
      <origin rpy="0 1.57075 1.57075" xyz="0 -0.085 0.032"/>
      <material name="wheel_metal">
        <color rgba="0.7 0.6 0.6 1"/>
      </material>
    </visual>
  </link>

  <link name="left_wheel">
    <visual>
      <geometry>
        <cylinder radius="0.032" length=".007"/>
      </geometry>
      <origin rpy="0 1.57075 1.57075" xyz="0 0.085 0.032"/>
      <material name="wheel_metal"/>
    </visual>
  </link>

  <link name="castor_support">
    <visual>
      <geometry>
        <box size="0.05 0.027 0.02"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0.1225 0 0.02"/>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
  </link>

  <link name="castor_wheel">
    <visual>
      <geometry>
        <sphere radius="0.01"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0.1225 0 0.01"/>
      <material name="black"/>
    </visual>
  </link>

  <link name="sensor_front_left">
    <visual>
      <geometry>
        <box size="0.03 0.022 0.01"/>
      </geometry>
      <origin rpy="0 1.57075 1.30915" xyz="0.082 -0.08 0.032"/>
      <material name="black"/>
    </visual>
  </link>

  <link name="sensor_front">
    <visual>
      <geometry>
        <box size="0.03 0.022 0.01"/>
      </geometry>
      <origin rpy="0 1.57075 0" xyz="0.11 0 0.05"/>
      <material name="black"/>
    </visual>
  </link>


  <link name="sensor_front_right">
    <visual>
      <geometry>
        <box size="0.03 0.022 0.01"/>
      </geometry>
      <origin rpy="0 1.57075 1.83235" xyz="0.082 0.08 0.032"/>
      <material name="black"/>
    </visual>
  </link>

  <link name="sensor_rear_right">
    <visual>
      <geometry>
        <box size="0.03 0.022 0.01"/>
      </geometry>
      <origin rpy="0 1.57075 0" xyz="-0.082 -0.08 0.032"/>
      <material name="black"/>
    </visual>
  </link>


  <link name="sensor_rear_left">
    <visual>
      <geometry>
        <box size="0.03 0.022 0.01"/>
      </geometry>
      <origin rpy="0 1.57075 0" xyz="-0.082 0.08 0.032"/>
      <material name="black"/>
    </visual>
  </link>

  <joint name="body_to_cover" type="fixed">
    <parent link="body"/>
    <child link="cover"/>
    <origin xyz="0 0 0"/>
  </joint>

  <joint name="body_to_right_wheel" type="fixed">
    <parent link="body"/>
    <child link="right_wheel"/>
    <origin xyz="0 0 0"/>
  </joint>

  <joint name="body_to_left_wheel" type="fixed">
    <parent link="body"/>
    <child link="left_wheel"/>
    <origin xyz="0 0 0"/>
  </joint>

  <joint name="body_to_castor_support" type="fixed">
    <parent link="body"/>
    <child link="castor_support"/>
    <origin xyz=" 0 0 0"/>
  </joint>

  <joint name="castor_support_to_castor_wheel" type="fixed">
    <parent link="castor_support"/>
    <child link="castor_wheel"/>
    <origin xyz=" 0 0 0"/>
  </joint>

  <joint name="base_to_body" type="fixed">
    <parent link="base_link"/>
    <child link="body"/>
    <origin ...
(more)
edit flag offensive delete link more

Comments

Thanks for the example. I was trying to convert my osg (or stl) model to a working mesh but cannot get it to display in rviz. I cannot get tutorial examples to display... I will test your approach tomorrow,

TommyP gravatar image TommyP  ( 2013-02-21 12:22:13 -0500 )edit

I haven't played with it myself, but check out ivcon.

David Lu gravatar image David Lu  ( 2013-02-21 12:45:54 -0500 )edit

Which tutorial example are you referring to?

David Lu gravatar image David Lu  ( 2013-02-21 12:46:24 -0500 )edit

The one about building your first urdf file. I cannot get something like " <mesh filename="package://lrs_quad/meshes/lq.dae"/>" to work in groovy. The tutorial used l_finger.dae were I did not have the file in the exact place as the tutorial gave.

TommyP gravatar image TommyP  ( 2013-02-21 20:29:41 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-02-21 07:46:45 -0500

Seen: 435 times

Last updated: Feb 21 '13