1. A computer-implemented method for actively aligning a first optical element to a second optical element, the method comprising performing, by a processor, operations of causing a robot to continuously scan the first optical element along a trajectory from a starting location to an ending location; while the robot continuously scans the first optical element from the starting location to the ending location: storing a plurality of time spaced-apart positions of the first optical element; and acquiring a plurality of time spaced-apart alignment data items, wherein each alignment data item of the plurality of time spaced-apart alignment data items: results from an optical signal that passed through the first optical element and was received by the second optical element; and contains data indicative of a degree of optical alignment between the first optical element and the second optical element; estimating a desired alignment position, based at least in part on the plurality of time spaced-apart alignment data items and the plurality of time spaced-apart positions of the first optical element; and causing the robot to move the first optical element to the desired alignment position.