Calibration program

Note

If you want to perform perform robot-camera calibration infrequently, you don’t need to write a calibration robot program. You can teach the calibration poses manually using the robot pendant and the Collect current pose button of the calibration wizard.

If, on the other hand, you expect to run calibration multiple times, an automated calibration program makes sense. You can run it whenever the camera has moved with respect to its fixture. This is the case when you’re setting up your application and the camera location is not yet fully decided. It can also be the result of calibration validation detecting an unexpected change.

Performing robot-camera calibration programmatically is a simple task. It consists of teaching a number of calibration poses and iterating through them as Pickit detects the calibration plate.

The following robot programs exemplify how robot-camera calibration can be performed without any human intervention, nor any action on the Pickit web interface.

Multi-pose calibration

Fully automated

Learn more about multi-pose calibration.

 1if not pickit_is_running():
 2    print("Pickit is not in robot mode. Please enable it in the web interface.")
 3    halt()
 4
 5# Calibration poses (needs replacing with actual values).
 6calib_pose_1 = [x,y,z,rx,ry,rz]
 7calib_pose_2 = [x,y,z,rx,ry,rz]
 8calib_pose_3 = [x,y,z,rx,ry,rz]
 9calib_pose_4 = [x,y,z,rx,ry,rz]
10calib_pose_5 = [x,y,z,rx,ry,rz]
11
12# Configure calibration using current calibration settings in the UI.
13# You can alternatively be explicit and force the configuration settings like so:
14#
15# config_ok = pickit_configure_calibration(METHOD_MULTI_POSE, CAMERA_MOUNT_ON_ROBOT)
16
17config_ok = pickit_configure_calibration()
18
19if not config_ok:
20    # Add actions to perform on failed configuration.
21    exit()  # Do not continue program execution.
22
23# Move to each calibration pose and trigger a calibration plate detection.
24movej(calib_pose_1)
25pickit_find_calibration_plate()
26
27movej(calib_pose_2)
28pickit_find_calibration_plate()
29
30movej(calib_pose_3)
31pickit_find_calibration_plate()
32
33movej(calib_pose_4)
34pickit_find_calibration_plate()
35
36movej(calib_pose_5)
37pickit_find_calibration_plate()
38
39# Compute the robot-camera calibration.
40calibration_ok = pickit_compute_calibration()
41
42if not calibration_ok:
43    # Add actions to perform on failed calibration.

Pose collection only

For robot integrations that don’t support manual pose collection, a robot program that iterates through the calibration poses and triggers plate detection is required when using the calibration wizard. In such cases, the program looks like this:

 1# Calibration poses (needs replacing with actual values).
 2calib_pose_1 = [x,y,z,rx,ry,rz]
 3calib_pose_2 = [x,y,z,rx,ry,rz]
 4calib_pose_3 = [x,y,z,rx,ry,rz]
 5calib_pose_4 = [x,y,z,rx,ry,rz]
 6calib_pose_5 = [x,y,z,rx,ry,rz]
 7
 8# Move to each calibration pose and trigger a calibration plate detection.
 9movej(calib_pose_1)
10pickit_find_calibration_plate()
11
12movej(calib_pose_2)
13pickit_find_calibration_plate()
14
15movej(calib_pose_3)
16pickit_find_calibration_plate()
17
18movej(calib_pose_4)
19pickit_find_calibration_plate()
20
21movej(calib_pose_5)
22pickit_find_calibration_plate()

Single-pose calibration

Learn more about single-pose calibration.

 1if not pickit_is_running():
 2    print("Pickit is not in robot mode. Please enable it in the web interface.")
 3    halt()
 4
 5# Calibration pose (needs replacing with actual values).
 6calib_pose = [x,y,z,rx,ry,rz]
 7
 8# Configure calibration using current calibration settings in the UI.
 9# You can alternatively be explicit and force the configuration settings like so:
10#
11# flange_T_plate = [x,y,z,rx,ry,rz]  # Helper transformation.
12# config_ok = pickit_configure_calibration(METHOD_SINGLE_POSE,
13#                                          CAMERA_MOUNT_FIXED,
14#                                          flange_T_plate)
15config_ok = pickit_configure_calibration()
16
17if not config_ok:
18    # Add actions to perform on failed configuration.
19    exit()  # Do not continue program execution.
20
21# Move to the calibration pose and trigger a calibration plate detection.
22movej(calib_pose)
23pickit_find_calibration_plate()
24
25# Compute the robot-camera calibration.
26calibration_ok = pickit_compute_calibration()
27
28if not calibration_ok:
29    # Add actions to perform on failed calibration.