When receiving a FinishTrajectory call, the Cartographer nodes catches up on computing loop closures, runs a final optimization, and when in 2D writes out a PGM map similar to map_saver.