introlab / find-object

Find-Object project
http://introlab.github.io/find-object/
BSD 3-Clause "New" or "Revised" License
447 stars 189 forks source link

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

Open soleman1214 opened 2 years ago

soleman1214 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

Masoumehrahimi commented 2 years ago

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.