Autonomous Trajectory Planning for Satellite RPO and Safety of Flight Using Convex Optimization