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

Transforming a pose to PR2 base frame in Python using TF

asked 2019-01-24 15:38:08 -0500

Tawfiq Chowdhury gravatar image

Hi, I am working on a new grasping project. My mate developed a system to detect pose of an object with respect to camera/kinect in ros. I am working in ubuntu 14.04 and ros version is Indigo. For now, I need to take a pose value from a file or something else, then I need to transform that pose of the object to PR2's base frame so that from there, I can use the moveit interface to move PR2's arm to grasp the object. I have searched in the internet about some transformation of pose using tf, I would not like to use tf2 as it is not fully tested yet. I would like to work in the simulator first and I am trying to make sense of a sequence of actions. So, my first job should be to take a pose value (position and orientation, (x,y,z), (x,y,z,w)) and transform it to PR2 base frame, and I would work in python. So, I need some guidelines for the approach. Could anyone advise where to start? I am not looking for tf tutorials but a sample code or link to an example would help.

Thank you.

edit retag flag offensive close merge delete

Comments

1

I would not like to use tf2 as it is not fully tested yet

can you tell us where you found this? tf2 is more than 6 years old now and has been used in countless applications. tf is deprecated -- and in fact: implemented on top of tf2.

You'll want to use tf2.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-25 02:57:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-01-25 04:08:06 -0500

This is very straightforward using tf2. If you setup a tfBuffer object with a tfListener as described in this tf2 tutorial. Then you can use the transform method of the tfBuffer object to transform the pose msg directly from one frame to the other.

This tutorial is very close to exactly what you're trying to do, I really recommend working through it and understanding what's going on. Simply copying and pasting someone else's code example into your project is never a good idea.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-01-24 15:38:08 -0500

Seen: 315 times

Last updated: Jan 25 '19