How to get joint coordinates of each joint?

Hi @engineer

Thanks for your insight!

I have just written a URScript function that built upon @sba’s great work

I hope that you will help you reach your goal!


####
# get the pose for the joint index(0-5)
##
#### input arguments
# joint index
# joint positions
# robot_gen: the generation of the robot
#		3: CB3
#		5: e-Series
# robot_model: the robot model
#		3: UR3/UR3e
#		5: UR5/UR5e
#		10: UR10/UR10e
##
#### return values
# position: X, Y, Z coordinates of wrist 1 origin
##
####
def get_joint_pose(joint_index, joint_positions= get_target_joint_positions(), robot_model =3, robot_gen=5):
	local n=1
	local pose = p[0,0,0,0,0,0]
	while n <= joint_index+1:
		local t = get_transformation_pose_frame(robot_gen, robot_model, n, joint_positions) 
		pose = pose_trans(pose, t)
		n=n+1
	end
	return pose
end