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

How to run ik_openrave.py with my URDF file?

asked 2011-05-04 04:23:50 -0600

updated 2011-05-04 09:06:57 -0600

I am trying to run OpenRave's IK service with my URDF file for the Katana 450 6M90A arm, running diamondback. The URDF file can be found in the katana_description package. Here is what I did:

rosrun xacro xacro.py katana.urdf.xacro > katana6m90a.urdf
rosrun collada_urdf urdf_to_collada katana6m90a.urdf katana6m90a.dae
rosrun orrosplanning ik_openrave.py --scene="katana6m90a.dae"

The last command very briefly shows the viewer displaying my arm model, then quits with the following output:

[openravepy_int.cpp:3267] viewer qtcoin successfully attached
initializing, please wait for ready signal...
Traceback (most recent call last):
  File "/home/martin/ros/stacks/openrave_planning/orrosplanning/ik_openrave.py", line 60, in <module>
    robot = env.GetRobots()[0]
IndexError: list index out of range

Running ik_openrave.py without parameters works and displays the PR2 model. What am I doing wrong?

EDIT: Thanks Antons, now I get one step further. Using this xml file...

<Robot name="katana6m90a" file="katana6m90a.dae">
  <Manipulator name="arm">
    <base>katana_base_link</base>
    <effector>katana_gripper_tool_frame</effector>
    <joints>katana_l_finger_joint katana_r_finger_joint</joints>
    <closingdirection>-1 -1</closingdirection>
    <direction>0 0 1</direction>
    <translation>0 0 0</translation>
  </Manipulator>
</Robot>

... I get:

[openravepy_int.cpp:3272] viewer qtcoin successfully attached
initializing, please wait for ready signal...
[xmlreaders.cpp:2331] Failed to find manipulator base katana_base_link
[xmlreaders.cpp:2323] Failed to find manipulator end effector katana_gripper_tool_frame
[Robot.cpp:2320] manipulator arm has undefined base and end effector links
[Robot.cpp:2329] could not find gripper joint katana_l_finger_joint for manipulator arm
[Robot.cpp:2329] could not find gripper joint katana_r_finger_joint for manipulator arm
terminate called after throwing an instance of 'OpenRAVE::openrave_exception'
  what():  openrave (Assert): [/usr/include/boost/smart_ptr/shared_ptr.hpp:418] -> T* boost::shared_ptr< <template-parameter-1-1> >::operator->() const [with T = OpenRAVE::KinBody::Link], expr: px != 0
[1]    25820 abort (core dumped)  rosrun orrosplanning ik_openrave.py --scene="katana6m90a.robot.xml"

I had a look at your wubble_description and tried to figure out what I was doing wrong, but no luck. Any more ideas? :-)

edit retag flag offensive close merge delete

Comments

Hmm, it looks like it can't find the links you specified in the dae file. Can you visualize your dae file in OpenRAVE by running: rosrun openrave openrave -f `rospack find path_to_katana`/katana.dae?
arebgun gravatar image arebgun  ( 2011-05-04 10:49:27 -0600 )edit

4 Answers

Sort by » oldest newest most voted
2

answered 2011-05-04 10:58:41 -0600

In order to do successful collada export, you need to use the robot_model trunk, the robot_model diamondback has an old exporter.

Please check out

svn co https://code.ros.org/svn/ros-pkg/stacks/robot_model/trunk robot_model

and make sure it is declared first in your ROS_PACKAGE_PATH variable, then remake all your projects.

Afterwords, run:

rosrun openrave openrave0.3-robot.py yourrobot.dae --list links

this will give you the list of links you can choose from so you can edit your manipulator description.

edit flag offensive delete link more

Comments

Thanks Rosen, that did it! (Long version, for posterity: it fixed the "failed to find..." error, after the EDIT)
Martin Günther gravatar image Martin Günther  ( 2011-05-04 22:07:02 -0600 )edit
1

answered 2011-05-04 06:01:24 -0600

arebgun gravatar image

updated 2011-05-04 06:03:16 -0600

Martin,

You also need to tell OpenRAVE about your manipulator/end-effector (e.g. finger joints, closing direction, etc). Currently URDF doesn't contain that information explicitly so you have to create it manually. What you need to do is create an xml file with content similar to this:

example OpenRAVE manipulator definition

Then you can run:

rosrun orrosplanning ik_openrave.py --scene="katana.xml"
edit flag offensive delete link more

Comments

Just a comment for the benefit of later readers: this fixed my first error, before the EDIT. Thank you!
Martin Günther gravatar image Martin Günther  ( 2011-05-04 22:08:02 -0600 )edit
0

answered 2011-05-04 11:26:35 -0600

I checked out your repository and did the conversation. a working wrapper is:

<robot file="katana.dae">
  <base>katana_base_link</base>
  <effector>katana_gripper_link</effector>
  <joints>katana_r_finger_joint katana_l_finger_joint</joints>
  <closingdirection>-1 -1</closingdirection>
</robot>

Unfortunately your katana urdf is a little broken (see attached image). the base link katana0 is not attached to katana_base_link. this puts the robot initially in self-collision.

katana arm is separated

edit flag offensive delete link more

Comments

Hi Rosen, now I can reproduce the error; however, the URDF is fine. The two disconnected links in your picture (katana_internal_controlbox_link on the bottom and katana_base_link on top) are connected by a fixed_joint. In ROS, everything works, and I guess it shouldn't be a problem in OpenRAVE.
Martin Günther gravatar image Martin Günther  ( 2011-05-04 22:04:35 -0600 )edit
0

answered 2011-05-04 22:49:50 -0600

i was pretty sure fixed joints were getting exported correctly, give me some time to check this out

edit flag offensive delete link more

Comments

Yes, my model contains other fixed joints, they work allright. Perhaps the problem is only when the root joint is fixed. Since the arm is available with and without the controlbox, I do all planning in the katana_base_link frame. I should probably split out the controlbox into a separate URDF file.
Martin Günther gravatar image Martin Günther  ( 2011-05-04 23:21:28 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2011-05-04 04:23:50 -0600

Seen: 2,439 times

Last updated: May 04 '11