Continuous-time Trajectory Estimation and its Application to Sensor Calibration and Differentially Flat Systems