大意:ad Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
提取选定项的坐标。
#1
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??
#2
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
#3
Thank you for your help!!




Users browsing this thread:
1 Guest(s)