Warning
You are reading the documentation for an older Pickit release (3.1). Documentation for the latest release (3.4) can be found here.
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]
11calib_pose_6 = [x,y,z,rx,ry,rz]
12calib_pose_7 = [x,y,z,rx,ry,rz]
13calib_pose_8 = [x,y,z,rx,ry,rz]
14calib_pose_9 = [x,y,z,rx,ry,rz]
15calib_pose_10 = [x,y,z,rx,ry,rz]
16
17# Configure calibration using current calibration settings in the UI.
18# You can alternatively be explicit and force the configuration settings like so:
19#
20# config_ok = pickit_configure_calibration(METHOD_MULTI_POSE, CAMERA_MOUNT_ON_ROBOT)
21
22config_ok = pickit_configure_calibration()
23
24if not config_ok:
25 # Add actions to perform on failed configuration.
26 exit() # Do not continue program execution.
27
28# Move to each calibration pose and trigger a calibration plate detection.
29movej(calib_pose_1)
30pickit_find_calibration_plate()
31
32movej(calib_pose_2)
33pickit_find_calibration_plate()
34
35movej(calib_pose_3)
36pickit_find_calibration_plate()
37
38movej(calib_pose_4)
39pickit_find_calibration_plate()
40
41movej(calib_pose_5)
42pickit_find_calibration_plate()
43
44movej(calib_pose_6)
45pickit_find_calibration_plate()
46
47movej(calib_pose_7)
48pickit_find_calibration_plate()
49
50movej(calib_pose_8)
51pickit_find_calibration_plate()
52
53movej(calib_pose_9)
54pickit_find_calibration_plate()
55
56movej(calib_pose_10)
57pickit_find_calibration_plate()
58
59# Compute the robot-camera calibration.
60calibration_ok = pickit_compute_calibration()
61
62if not calibration_ok:
63 # 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]
7calib_pose_6 = [x,y,z,rx,ry,rz]
8calib_pose_7 = [x,y,z,rx,ry,rz]
9calib_pose_8 = [x,y,z,rx,ry,rz]
10calib_pose_9 = [x,y,z,rx,ry,rz]
11calib_pose_10 = [x,y,z,rx,ry,rz]
12
13# Move to each calibration pose and trigger a calibration plate detection.
14movej(calib_pose_1)
15pickit_find_calibration_plate()
16
17movej(calib_pose_2)
18pickit_find_calibration_plate()
19
20movej(calib_pose_3)
21pickit_find_calibration_plate()
22
23movej(calib_pose_4)
24pickit_find_calibration_plate()
25
26movej(calib_pose_5)
27pickit_find_calibration_plate()
28
29movej(calib_pose_6)
30pickit_find_calibration_plate()
31
32movej(calib_pose_7)
33pickit_find_calibration_plate()
34
35movej(calib_pose_8)
36pickit_find_calibration_plate()
37
38movej(calib_pose_9)
39pickit_find_calibration_plate()
40
41movej(calib_pose_10)
42pickit_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.