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

Unable to move links within URDF file

asked 2015-11-28 10:55:39 -0500

rbaleksandar gravatar image

updated 2015-12-07 10:19:37 -0500

lucasw gravatar image

Hi!

I'm currently struggling with URDF. The model of the robot is a Kuka KR3 CR. I used a Collada file (from OpenRAVE's collection of robots - Rosen Diankov actually created this model for a previous project of mine :)). There were a couple of problems with it (including partially flipped normals of some of the faces and some of the links (you can see that in the image below - a screenshot from OpenRAVE's visualization tool) have some weird geometry issues:

image description

That's why I used Blender and Meshlab to fix the issues. In order to obtain the separate links I used the collada_to_urdf tool. It extracted an URDF file along with the links (one Collada file per link which I converted to OBJ format). It seems however that the tool doesn't work properly and some of the links are now not where they are supposed to be:

image description

I tried changing those but moveit setup assistant doesn't show the changes for some reason...

The original URDF can be seen below (I replaced values such as 6.1342423e-33 with 0 since those are obviously rounding errors):

 <?xml version="1.0"?>
  <robot name="KR3CR"
     xmlns:xi="http://www.w3.org/2001/XInclude"
     xmlns:gazebo="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"
     xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"
     xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
     xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"
     xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"
     xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"
     xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
     xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering"
     xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable"
     xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
     xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics">

  <link name="link1">
    <visual>
      <origin xyz="0 0 0" rpy="0 -0 0"/>
      <geometry>
        <mesh filename="package://urdf_collection/meshes/kr3cr/link_1.obj" scale="1 1 1" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <mesh filename="package://urdf_collection/meshes/kr3cr/link_1.obj" scale="1 1 1" />
      </geometry>
    </collision>
    <inertial>
      <mass value="1" />
      <origin xyz="0 0 0" rpy="0 -0 0"/>
      <inertia ixx="0.4" ixy="0" ixz="0" iyy="0.4" iyz="0" izz="0.4"/>
    </inertial>
  </link>

  <link name="link2">
    <visual>
      <origin xyz="0 0 0" rpy="3.14159 0 0"/>
      <geometry>
        <mesh filename="package://urdf_collection/meshes/kr3cr/link_2.obj" scale="1 1 1" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="3.14159 0 0"/>
      <geometry>
        <mesh filename="package://urdf_collection/meshes/kr3cr/link_2.obj" scale="1 1 1" />
      </geometry>
    </collision>
    <inertial>
      <mass value="1" />
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <inertia ixx="0.4" ixy="0" ixz="0" iyy="0.4" iyz="0" izz="0.4"/>
    </inertial>
  </link>

  <link name="link3">
    <visual>
      <origin xyz="0.1 0 -0.35" rpy="1.5708 -0 0"/>
      <geometry>
        <mesh filename="package://urdf_collection/meshes/kr3cr/link_3.obj" scale="1 1 ...
(more)
edit retag flag offensive close merge delete

Comments

I'd suggest to use the display.launch file from urdf_tutorial instead of the Setup Assistant to check your urdf. It will also allow you to make sure your axes are configured correctly.

gvdhoorn gravatar image gvdhoorn  ( 2015-11-28 14:39:45 -0500 )edit

Thanks. The moveit setup assistant actually does provide an extensive info about the file that is loaded. I'll give you suggestion a go though. This still doesn't explain why changing the values inside the URDF file doesn't result in any visual change. :-/

rbaleksandar gravatar image rbaleksandar  ( 2015-11-28 16:51:30 -0500 )edit

If you can make the files + meshes available somewhere, I'm willing to take a look. As far as the colours go: OBJ supports materials, so it may be that any material tags are ignored in favour of the info in the OBJ.

gvdhoorn gravatar image gvdhoorn  ( 2015-11-30 03:58:58 -0500 )edit

Takes a lot for the offer. If you don't mind, I'll take you up on it. ;) I have updated my question at the end to include a git repo with the files. I have also merged my stuff with the urdf_tutorial package.

rbaleksandar gravatar image rbaleksandar  ( 2015-12-02 13:43:44 -0500 )edit

If this is still an issue, I'll take a look tomorrow.

gvdhoorn gravatar image gvdhoorn  ( 2015-12-03 14:02:15 -0500 )edit

If it's not a problem for you, I'd appreciate it. Still working on it.

rbaleksandar gravatar image rbaleksandar  ( 2015-12-04 09:17:10 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-05 05:53:10 -0500

gvdhoorn gravatar image

I've just opened a pull request against your repository, see aleksandaratanasov/urdf_collection#1.

A copy/paste of the PR description, so it doesn't get lost:

Basically, I haven't even tried to diagnose the original URDF, as there were too many issues with it, probably due to the conversion done by collada_to_urdf. I also suspect a discrepancy between the joint transforms in the original urdf and the meshes that were converted separately.

In the end, I:

  • converted everything to a xacro macro (added top-level xacro as well)
  • made naming consistent with ROS standards (base_link, etc)
  • cleaned up all urdf joint transforms: based on data from a KR 3 CR datasheet
  • removed collada->urdf conversion artefacts (unnecessary xml ns decls, etc)
  • changed origins of all meshes to be relative to the joint zero, instead of to the global robot zero
  • scaled meshes (ROS uses meters, meshes were in millimeters)
  • fixed orientations of all meshes: X forward, Y to the left, Z up (ROS standard)
  • created collision quality meshes (convex hulls)
  • split out visual and collision quality meshes of KR 3 CR into separate directories

Note:

  • origins of all intertial elements has been reset to zeros as I don't know what the real values should be
  • masses, origins and values for inertia elements are incorrect
  • effort limits of all joints have suspicious values (if unknown, just leave them at zero, unless you need to simulate with Gazebo obviously)
  • dynamics element attributes seem to have standard values

I also added two convenience launch files to easily load and display the model in RViz (roslaunch urdf_collection test_kr3cr.launch).

Most of this is based on the Create a URDF for an Industrial Robot and Working with ROS-Industrial Robot Support Packages tutorials from ROS-Industrial.

I also created a test MoveIt configuration to verify the model and could successfully plan for it.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-11-28 10:55:39 -0500

Seen: 1,305 times

Last updated: Dec 07 '15