Calibration - Camera#

This section describes how to perform the camera calibration procedure for your Duckiebot.

Every camera is unique. Therefore, a camera calibration procedure needs to be performed to account for small manufacturing discrepancies. This procedure involves displaying a predetermined pattern in front of the camera and using it to solve for the camera’s parameters. For more information, review these slides.

What you will need

You can see what your Duckiebot sees.

What you will get

Your Duckiebot’s camera will be calibrated.

Attention

Complete both the camera and kinematics calibration procedures before running any Duckietown demos.

Calibration board#

../../_images/a3-calibraion-pattern.png

Fig. 53 Duckietown calibration pattern.#

If you do not already have a Duckietown calibration board:

  1. Download the Duckietown calibration pattern

  2. Print it in A3 format

  3. Fix it to a rigid planar surface that you can move around

Note

  • The squares must have side lengths equal to 0.031 m (3.1 cm). Measure this, as having the wrong size may lead to your Duckiebot crashing.

  • In case your squares are not the correct size, make sure that your printer settings are set to A3 format, with no automatic scaling and size set to 100%.

If you do not already have a Duckietown calibration board:

  1. Download the Duckietown calibration pattern

  2. Print it in A4 format

  3. Fix it to a rigid planar surface that you can move around

Note

  • The squares must have side lengths equal to 0.0175 m (1.75 cm). Measure this, as having the wrong size may lead to your Duckiedrone crashing.

  • In case your squares are not the correct size, make sure that your printer settings are set to A4 format, with no automatic scaling and size set to 100%.

Warning

If the pattern is not rigid, the calibrations should not be used. You can print on thick paper or adhere to something rigid to achieve this.

Intrinsics calibration#

The Intrinsics Calibrator#

The easiest way to perform the intrinsics camera calibration prodecure for your Duckiebot is by using the Intrinsics Calibrator.

../../_images/intrinsics_calibrator_1.png

Fig. 54 The Intrinsics Calibrator.#

To activate the Intrinsics Calibrator, run:

dts duckiebot calibrate_intrinsics ![DUCKIEBOT_NAME]

Note the keys in the table below.

Key

Function

X

Increase the Frame Rate

Z

Decrease the Frame Rate

Space

Calibrate the camera

F

Toggle the Undistort switch

R

Refresh the window

T

Open the Debug Console

Procedure#

To perform the intrinsics calibration procedure:

  1. Move the calibration board in front of your Duckiebot’s camera such that the entire checkerboard pattern is within its field of view and colored lines begin to overlay the checkerboard pattern

  2. Rotate the mechanical focus ring on the lens until you can clearly read the x and y labels on the checkerboard pattern (do not adjust the focus again or place the lens cover back onto the lens unless you plan on repeating this procedure)

  3. Slowly move the calibration board left, right, up, down, forwards and backwards, relative to your Duckiebot’s camera, until each region within the x, y and Size bars is filled in

  4. Slowly tilt and pan the calibration board, relative to your Duckiebot’s camera, until each region within the Skew bar is filled in

  5. Click the Calibrate button

  6. Wait for the spinner to disappear

  7. (optional) Click the Undistort switch to see an undistorted view of what your Duckiebot sees

../../_images/intrinsics_calibrator_2.png

Fig. 55 The Intrinsics Calibrator with all of its bars filled in.#

../../_images/intrinsics_calibrator_3.png

Fig. 56 The Intrinsics Calibrator with the Undistort switch set to on.#

To confirm that a new intrinsics calibration file has been created on your Duckiebot, run the following command and inspect the contents of the Camera Intrinsic panel:

dts duckiebot dashboard ![DUCKIEBOT_NAME] --page robot/calibrations
../../_images/camera_intrinsic_panel.png

Fig. 57 The Camera Intrinsic panel on the Robot page of the Dashboard.#

Note

Within the Camera Intrinsic panel, under Local, you should see a tick next to Completed, the calibration date next to Calibration date and /data/config/calibrations/camera_intrinsic/![DUCKIEBOT_NAME].yaml next to Files.

Extrinsics calibration#

The Extrinsics Calibrator#

The easiest way to perform the extrinsics camera calibration procedure for your Duckiebot is by using the Extrinsics Calibrator.

../../_images/extrinsics_calibrator_1.png

Fig. 58 The Extrinsics Calibrator.#

To activate the Extrinsics Calibrator, run:

dts duckiebot calibrate_extrinsics ![DUCKIEBOT_NAME]

Note the keys in the table below.

Key

Function

X

Increase the Frame Rate

Z

Decrease the Frame Rate

Space

Calibrate the camera

F

Toggle the Project switch

R

Refresh the window

T

Open the Debug Console

Procedure#

To perform the extrinsics calibration procedure:

  1. Position your Duckiebot on the calibration board such that it faces the checkerboard pattern, your Duckiebot’s axle is parallel to and directly above the large y-axis of the calibration board, and the axis that is perpendicular to and midway between your Duckiebot’s axle is directly above the large x-axis of the calibration board (the trapezoid in the image under Camera View should turn from black to green)

  2. Click the Calibrate button

  3. Wait for the spinner to disappear

  4. (optional) Click the Project switch to see a top-down view of what your Duckiebot sees under Projection

../../_images/extrinsic_setup.jpg

Fig. 59 Extrinsics calibration setup.#

../../_images/extrinsics_calibrator_2.png

Fig. 60 The Extrinsics Calibrator with the Project switch set to on.#

To confirm that a new extrinsics calibration file has been created on your Duckiebot, run the following command and inspect the contents of the Camera Extrinsic panel:

dts duckiebot dashboard ![DUCKIEBOT_NAME] --page robot/calibrations
../../_images/camera_extrinsic_panel.png

Fig. 61 The Camera Extrinsic panel on the Robot page of the Dashboard.#

Note

Within the Camera Extrinsic panel, under Local, you should see a tick next to Completed, the calibration date next to Calibration date and /data/config/calibrations/camera_extrinsic/![DUCKIEBOT_NAME].yaml next to Files.

Troubleshooting#

Troubleshooting

SYMPTOM

I do not see what my Duckiebot sees after refreshing the window and going through Operation - Make it See - Troubleshooting.

RESOLUTION

Contact support.