Hi everyone, I’m trying to pick up pieces from a plate using a fixed Cognex camera and a UR robot.
The camera is calibrated using the fiducial grid, and I’ve created a feature plane on the robot that corresponds to the camera’s reference system.
The camera returns the x, y, and z rotation coordinates.
If the parts are oriented like the master image from the camera, there’s no problem, but if the orientation is different, the x-y-rz coordinates aren’t accurate (they differ slightly).
The point coordinates are calculated as follows: point = p[x_camera, y_camera, 0, 0, d2r(rz_camera)]
x_camera and y_camera are in meters.
To move the robot, I use MoveL with the camera feature plane.
Can you give me any advice on how to resolve this coordinate discrepancy?
The coordinates by the robot are not rx ry and rz for the last 3 elements in a position. They are a rotation vector. This confused me for a while coming from other robots systems..
The below code is what I happen to use to apply to rotation a cognex camera gives me to a robot position. Mine is all in offset from the taught position, where as it looks like you are doing absolute positions from the camera… but you can just create the rot_rad_vec and use it’s 3 elements directly without doing the pose_add that I am doing
rot_rad_vec = rpy2rotvec([0,0,-d2r(Ang)])
global FoundPose = pose_add(FoundPose,p[0,0,0,rot_rad_vec[0],rot_rad_vec[1],rot_rad_vec[2]]) # add rotation