Part coordinates vs Tool Coordinates

Hi,
I have an application question. With respect to the picture attached. what will be the easiest way to let user to key in a degree and the robot will move the number of degree base on the pivot point? Am i right to say that, if i get the correct TCP, i can use moveC to achieve?

what I would properly have done

  1. is to set the tcp to the pivot point.
  2. get the actual tcp pose
  3. change the angle of this pose
  4. move to the new pose using movej
  5. reset the tcp to the tool tcp

Best regards

Hi @hclai77,
welcome to the UR forum :grinning:

If you set the TCP in the center of the pivot point, then you can just use a couple of movel:

ezgif-5-36b839d23f

1 Like

Hi,
Thanks for a quick response and good illustration.
If the customer just want to specify the angle to be moved respective to this TCP, How should I implement this? Will it be just the movement of rotation in ‘Green’?

Regards,
Lai

You could use function rpy2rotvec to compute the angles for the rotated pose:

set_tcp(p[0, 0, 0.2, 0, 0, 0])

# start pose
pose = p[0.719, -0.026, 0.466, -1.51, 0.50, -0.50]
movel(pose)

# compute rotated pose angles 
angles = rpy2rotvec([0, d2r(30), 0])
v1 = angles[0]
v2 = angles[1]
v3 = angles[2]

# go to rotated pose
rotated_pose = pose_trans(pose, p[0, 0, 0, v1, v2, v3])
movel(rotated_pose)