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.
This multi-poses calibration example program requires the Pickit URCap plugin to be installed in your robot. For installation instructions of both the URCap plugin and the example programs, please refer to the URCap installation and setup article.
On the header bar, go to Program, then Open > Program, and open pickit_examples/calibration/multi_poses_calibration.urp
Program walkthrough
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.
Tip
Before running an automated calibration program, we recommend to run calibration from the Pickit web interface at least once. This allows a convenient way to set the calibration configuration, and provides a visual way to confirm that the calibration plate is visible from the different poses.
Lines 2-4: Configure calibration
Check that Pickit is in Robot mode, and call pickit_configure_calib() without arguments to instruct Pickit to use the calibration configuration already specified in the web interface. If you would like to override the configuration from the robot program, use the advanced variant of the configuration call instead.
Lines 5-34: Collect calibration poses
Perform ten times the sequence of moving to a calibration pose, and trigger plate detection. We recommend to use poses taught during a calibration from the Pickit web interface.
Lines 35-36: Compute calibration
Compute the new robot-camera calibration.
This program raises popups when Pickit fails to configure or compute the calibration. You can replace them with the error handling strategies that make best sense to your application.