# Calibrate a 2d scanner mounted on a rotary axis

A 2d laser scanner is mounted on a rotary axis. I wish to determine the transformation matrix from the center of the axis to the center of the scanner, using only the input from the scanner and the angle of rotation.

The 2d scanner itself is assumed to be calibrated, it will accurately measure the position of any object inside the plane of the laser, in regards to the scanner origin.

The rotary axis is calibrated as well, it will accurately measure the angle of its own movement.

The scanner is aligned and mounted close to the center of rotation, but the exact offset is unknown, and may drift over time.

Assume it is impractical to measure the position and orientation of the scanner directly. I am looking for a way to determine the exact values for the 6 degrees of offset the scanner may have in relation to the axis, determined solely on the 2d information from the scanner and the rotation angle from the axis.

I am mainly interested in the 4 offsets depicted here, since the other two do not matter in regard to generating a consistent 3d point cloud from the input data.

By scanning a known calibration object, it should be possible to determine these offsets. What are the mathematical formulas for this?

What sort of calibration information is required at a minimum? Is it for example possible to determine all parameters simply by scanning a flat surface, knowing nothing about the surface except that it is flat?

(The transformation matrix from rotation axis to world is unknown as well, but that one is trivial to determine once the transformation from axis to camera is known.)

Example

On the left the camera is placed exactly on the rotational axis. The camera scans a planar object with reference points A B and C. Based on the laser distance measurements and the angle of the axis, this planar object can be reconstructed.

On the right, the camera has an unknown offset to the axis. It scans the same object. If the point cloud is constructed without knowing this offset, the planar surface maps to a curved surface.

Can I calculate the offset based on the surface curvature?

If I know the real-world distances and angles between A, B and C, how can I calculate the camera offsets from that? What would be the minimum number of reference points I need for all 4 offsets?

If you can afford to have a small portion of your field of view obscured, you may want to consider having a fiducial object somewhere in view.

With a suitable fiducial object, scanning it as your axis rotates, you should be able to calculate the four offsets you desire.

If you cannot afford to have any of your field of view obscured under normal operation, then you may need to place your fiducial on an actuator of it's own, bringing it into view when you want to calibrate and taking it out for normal operation. The only issue here is that you limit the accuracy of your calibration by the accuracy of your fiducial actuator.

Note that if some part of your field of view is already obscured by another part of your robot, and it may be suitable to use as a fiducial, or at the very least as a mounting point for one.

• My problem is not placing a fiducial object, that is simple enough. My problem is calculating the offsets. As you say, it should be possible to calculate the four offsets based on a calibration object, but how? Let's say I scan a cube of known dimensions. I can easily see that my offsets are wrong if that cube is mapped to a non-planar, non-rectangular point cloud. But how do I get the correct offsets from that? Commented Feb 12, 2013 at 16:36
• Thanks for the clarification @HugoRune - if you could edit your question to include this information then hopefully the next person to answer will be able to provide a better answer. I've only ever done this sort of calibration having already simplified the problem down to 2D, so I can only give general advice. Commented Feb 12, 2013 at 19:10

The simplest method in this case is to essentially brute force the problem but to brute force it in an intelligent manner.

What you will need is a set of data from the scanner while it is scanning an object, preferably a mathematically simple object like a cube or a sphere and the exact offset position or offset of that object relative to the mount of this scanner.

If you have these two pieces of information the next trick is essentially testing various combinations scanner offsets (what I would typically call calibration values) until you find offsets that cause the scanner data to accurately represent your object. For this you can either randomly guess values which can take forever and not get anywhere (but in theory would eventually get you the right answer) or you can use an optimization method

To use an optimization method you will need to develop some sort of metric to say whether a particular set of offsets works better than another set. Then whatever optimization method you are using will use that score to say whether to adjust the values in a particular direction. Eventually it will settle on a particular set of values that seem to work best.

This is a pretty brief and poor description of a very in depth topic but hopefully it will get you pointed in a direction. If you would like a more detailed description of anything leave a comment.