How to get joint coordinates of each joint?

Hi,
I know that I can get joint angles of each joint.
How to get joint coordinates(x,y,z) of each joint?

Hi @engineer,

Welcome to the UR community!

they are not directly accessible, the content of the configuration files, described here

Will provide you with the information to make the forward kinematic calculations.

Can you elaborate on your use case?

Best regards
Ebbe

Hi @Ebbe , thanks for your reply

I use depth camera to catch robotic arm’s point cloud,want to get joint coordinates to match it.
That way I can know the position of the robotic arm in the point cloud to make obstacle avoidance function.

Is there any other way to get the coordinates of each joint, or can do something similar to the following video?

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