An autocollimator is an optical instrument used for measuring small angular measurements. It works by projecting a light source through a collimating lens, which is reflected off a target mirror. The angle of the reflected light is doubled, and can be measured based on the displacement seen through an eyepiece. Autocollimators are used to measure small angles and displacements, check for straightness and parallelism, and inspect flatness and squareness in machine tools. They offer high accuracy but require regular maintenance and can be time consuming.