# Is there an easy way to get the end effector name just from tf?

I have a node that queries move_group to get the end effector name, but uses move_group for nothing else. Ideally I would like to run this node without having to bring up move_group at all, and I don't want to hard code the name of the end effector. Is there a trivial way to solve this? I looked at the C++ code for getEndEffector in move_group_interface.cpp, but it needs some other libraries.

Is there a simple way to get this information by using only TransformListener, for instance?

edit retag close merge delete

Sort by » oldest newest most voted

I can think of one way, but it may not be too nice: every MoveIt configuration package contains a name_of_robot.srdf (see wiki/SRDF). This file contains additional information not found in the robot_description among which is the name of the configured end effector. As an example, see the config of the pr2:

<!--END EFFECTOR: Purpose: Represent information about an end effector.-->


As this file is valid SRDF, you could probably parse it with the SRDF library (or just any XML parser really), and retrieve the names of the defined EEFs.

PS: obviously, this does not use TF, but it does give you the information you are after without having to use any (large) additional dependencies.

more

I'll keep this in mind, but for now I am going to try the solution with the parameter server. Thanks for the help.

( 2014-07-04 02:57:37 -0600 )edit

The notion of an "end-effector" does not exist in TF, it is part of the semantics of the robot, and therefore is part of the SRDF. Thus, you should either parse the SRDF, or pass the name of the relevant end effector into the node. The easiest and probably most ROS-like way to do this is to use a parameter -- you aren't actually hard coding the value, but you can set it on startup of the node (even from the launch file that starts the node).

more

This solution sounds like the simplest. Thanks for the help.

( 2014-07-04 02:55:56 -0600 )edit

From TF alone this is impossible unless you make some non-generic assumptions. Any TF chain starting at the robot might end up at the end effector. You don't know which one this is unless you know the name or at least naming scheme. Also sometimes it really is a definition what the end effector is, e.g. for the PR2: Should it be the wrist_roll_link or the palm or finger or ...

more

I know, I should have specified that I will only be working with robot arms :) I don't believe we will ever encounter any branching, so for instance running through all the links to find one without a child link would likely work, but does require some additional coding.

( 2014-07-04 02:54:14 -0600 )edit