Online NMPC with obstacle avoidance