Piloted simulation of an onboard trajectory optimization algorithm