A nonlinear optimal control approach for the truck and N-trailer robotic system