Waypoint-optimized closed-loop guidance for spacecraft rendezvous in relative motion