Discrete Second Order Trajectory Generator with Nonlinear Constraints