RoboDK Forum
Extract the coordinates of the selected item.可打印版本

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: Extract the coordinates of the selected item. (/Thread-Extract-the-coordinates-of-the-selected-item--6010)



Extract the coordinates of the selected item.-sonchulho96-05-29-2022

Is there any way to extract all coordinates of the selected item??

-------------------------
from robodk.robolink import*

RDK = Robolink()

selected_item = RDK.Selection()
items = selected_item[0].Childs()
position = items[0].Pose()
print(position)



if I do this, it gonna print

Pose(1471.474, -626.612, -41.019, -24.000, 0.000, -143.158):
[[ -0.800, 0.600, 0.000, 1471.474 ],
[ -0.548, -0.731, 0.407, -626.612 ],
[ 0.244, 0.326, 0.914, -41.019 ],
[ 0.000, 0.000, 0.000, 1.000 ]]



I only need "1471.474, -626.612, -41.019, -24.000, 0.000, -143.158"
I can extract coordinates x, y, z
but I have no idea about position of angles..

Is there any way to extract the all coordinates??


RE: Extract the coordinates of the selected item.-Alex-05-29-2022

You can use :

Code:
position = robomath.Pose_2_TxyzRxyz(items[0].Pose())


Howwever, this will give you the angles in radians, not in degrees. You should be able to easily transform them by multiplying times 180/pi


RE: Extract the coordinates of the selected item.-sonchulho96-05-30-2022

Thank you for your help!!