Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to extract position of object from tf using python #119

Open
soleman1214 opened this issue Apr 19, 2022 · 4 comments
Open

How to extract position of object from tf using python #119

soleman1214 opened this issue Apr 19, 2022 · 4 comments

Comments

@soleman1214
Copy link

hello everyone,
I am facing a problem related to values extraction that are published in tf.
InkedScreenshot from 2022-04-14 11-42-51
I want the position values(x,y,z) of the object using python. Then I want to use these values in moveit package for inverse kinematics of robot to do pick and place tasks. Please help me how to get these values.

@matlabbe
Copy link
Member

matlabbe commented May 10, 2022

You will need a TF listener, then use lookuptransform function to get the pose of the object in target frame you want. To know when the TF of an object is ready, subscribe to /objectsStamped topic to get the stamp when the object is detected (for the lookupTransform).

EDIT: Here a C++ example: https://github.com/introlab/find-object/blob/master/src/ros/tf_example_node.cpp, this could be in python.

@Masoumehrahimi
Copy link

hello everyone, I am facing a problem related to values extraction that are published in tf. InkedScreenshot from 2022-04-14 11-42-51 I want the position values(x,y,z) of the object using python. Then I want to use these values in moveit package for inverse kinematics of robot to do pick and place tasks. Please help me how to get these values.

Hi Soleman,

Would you please also share your python code here? I have the same problem as well.
Kind Regards

@soleman1214
Copy link
Author

https://youtu.be/_LumIR61234
I followed this video.

@Masoumehrahimi
Copy link

https://youtu.be/_LumIR61234 I followed this video.

thanks a lot for the quick reply, but this video does not show using a python code for providing object position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants