Real-time nonlinear model predictive control for motion generation in robotic systems