Automatic alignment and calibration of an inertial navigation system