Move parallell to an object found by vision camera

I get a position with rotation from the vision camera, how do I move the robot with this rotation without rotating the tool flange?

I’m experimenting with a SICK Inspector vision camera. After I find the object, I want the robot to move linear to the rotation of the object.
After locating the object, I get a variable SICK_Pos from the camera that I translate to a point (obj_pose) in the base plane. (see attached code).
When I move to obj_pose, the tool flange lines up with the found object, and I can then move parallell to the object using Direction with Tool as feature.

However, to avoid having the tool flange rotate after every picture taken, I want to keep the same rotation on the tool flange but still move according to the rotation found by the camera.

I am able to fix the tool flange’s rotation by setting it to a specific value, but I havn’t figured out how to move with the rotation of the found object.

I’ve tried to assign the value of the point recieved from the camera to a plane, and then move according to that plane, but it doesn’t seem to work.

Is there a way to move according to the found object without having to rotate the tool flange?

Kind Regards,

So this is a script I use pretty often:

def getOffsetRelativeToFeature(x_offset, y_offset, z_offset, feature, poseToShift):
  return pose_trans(feature, pose_add(pose_trans(pose_inv(feature), poseToShift), p[x_offset, y_offset, z_offset, 0,0,0]))

You can modify the arguments as you need them. What this does is takes the “poseToShift” and shifts it x_offset, y_offset, and z_offset in the “feature” coordinate system. So for example:

shiftedPose = getOffsetRelativeToFeature(1,0,0, rot_plane, get_actual_tcp_pose())
would yield a position that took the current TCP location, and shifted it 1 meter (excessive but easy number) in rot_plane’s x direction. You’re then free to moveL/J/P to this position just like any other.

This script does not do any rotation, as you can see by the rx, ry, and rz values are hard-coded to 0. It purely translates relative to the feature.

1 Like