# Finding a frame pose given pose (calculated) of another frame

Hello everyone,

I am publishing r_gripper_pick_pose as, say, :

 <node name="btw_bl_rpp" pkg="tf" type="static_transform_publisher" args=
"3  1   8     0 0 0 1     base_link        r_gripper_pick_pose 10"
respawn="false" output="screen" />


I calculate the pose (with direction) for this frame (r_gripper_pick_pose) (say to pick up sth). Lets call it Calc_grasp_pose.

How can I find the base_link (i.e, robot pose) pose wrt the Calc_grasp_pose?

I guess I can not use TF for this as there is no frame being published which is b/w existing farmes and r_gripper_pick_pose. i.e, how can I use TF, if at all, to get new pose with transformation between two poses instead of two frames?

I am using ros electric.

Update:-

For clarification consider the following figure :

Consider a) I am considering base_link to be at origin. And all poses are described wrt it.

And for this case consider that robot is at orientation of 0 degrees if it is facing in +y direction (unlike +x in usual case of PR2 (i realized this after drawing the figure :-) ))

I need to move the robot (described by the big circle, with its gripper pose frame described by a small circle) such that its gripper is at the desired pose of (-5,3,8) and orientation (w,x,y,z) : (0,0,0,1), which is my calc_grasp_pose

So my desired situation is b). So I need the pose : (-4,1,0) and (w,x,y,z) : (0.7071, 0, 0, 0.7071) as output.

if I simply define the desired pose in r_gripper_pick_pose and use transformPose to get it into the base_link frame I will get back the desired pose of the r_gripper_pick_pose only or calc_grasp_pose. (Correct me if I am wrong)

The reason why I think I can't use TF is : the transformation between calc_grasp_pose and poses of other frames (like r_gripper_pick_pose, base_link) is dynamic and is not in tf.

calc_grasp_pose is not a frame, it is not published.

So one way for me could be to find the rotation and translation matrix which when applied to current r_gripper_pick_pose translates it to calc_grasp_pose, and then apply the same to base_link (in the picture base_link is at origin, but it could be anywhere). As described at : http://web.iitd.ac.in/~hegde/cad/lecture/L6_3dtrans.pdf

Is there any existing function which I can use in tf or some other place which I can use?

Thnks.

Originally posted by aknirala on ROS Answers with karma: 339 on 2013-04-16

Post score: 3

Comment by mathijsdelangen on 2014-12-11:
I was wondering. Did you find anything to help you with this in the meantime?

If I understand correctly what you want to do then this is exactly a use case of TF.

Define the calc_grasp_pose as a pose in the r_gripper_pick_pose frame and use transformPose to get it into the base_link frame.

Edit: Not sure if what you want can be solved directly with tf methods. Maybe someone will come up. However, you can do that manually. Retrieve the base_link -> gripper transfrom from tf as lets say tfGrp and if your desired pose is target, you'll have this chain:

result * tfGrp = target
-> result = target * tfGrp^-1


Originally posted by dornhege with karma: 31395 on 2013-04-17

This answer was ACCEPTED on the original site

Post score: 2