I’m having some trouble with a UR5/Cognex inspection system I’m working with.
I have a camera mounted on the end-of-arm locating a part on a conveyor, then sending coordinates (in millimeters; relative to the center of the camera’s field of view) to the UR.
The UR should then use those coordinates to guide the TCP of the picking tool directly onto the part. However, it is without fail several centimeters off when trying to pick from the conveyor belt. Conveyor tracking is working fine; the robot will follow a part perfectly, but in the wrong spot.
The problem is: before, when I had my program working in my office, I had a carefully calibrated feature defined where the origin and x-y axes of the platform where the part sat were perfectly matched to the camera’s origin and axes. Now, since the robot is supposed to be mobile and set up in various places, that won’t be possible anymore. I need to determine x and y offsets to account for the fact that the origin of the conveyor belt “feature” may be a couple feet away from the camera’s center.
I thought I could use get_actual_tcp_pose() and then grab x and y offsets from the result. The problem with that is the script code get_actual_tcp_pose() returns the position of a tool center in base coordinates, and I need conveyor belt feature coordinates. I’ve gotten very close results with the following code:
Pose1=get_actual_tcp_pose()
% this assigns a pose value to the current camera location, in base coordinates
Pose2=conveyor_belt
% conveyor_belt is the name of the conveyor feature, and this line assigns a pose value to the location of its % origin in base coordinates
Result=pose_trans(pose_inv(pose2),pose1)
X_offset=result[0]
Y_offset=result[1]
% These last 3 lines determine a pose vector from the tool center point to the conveyor feature origin and %.grab the x and y offsets from it, but in the TCP coordinate system, not the conveyor’s like I wanted
So now the problem is, since the TCP’s axes aren’t pointing the same direction as the conveyor’s, it’s still off…and the coordinate rotation I’ve tried applying around the z-axis isn’t fixing it.
I’ve also tried just doing all my moves in the base coordinates, with the same issue that the base x-y axes are not pointing the same direction as the camera’s, so it’s still off.
I don’t want to simply put in a manual offset because that’s going to change every time. The robot and camera need to do this without user input.
So after beating my head against this problem for several days, I’m hoping someone has ideas.