Autonomous navigation of a flexible surgical robot in the lungs