Online trajectory planner with constraints on velocity, acceleration and torque