A robotic medical system with a flexible guide tube, such as a pulmonary catheter, can record the shape of the guide tube in the target configuration. If the shape includes a sharp bend than the sharpest allowable bend for insertion or removal of a tool such as a biopsy needle, the control system will find every location of the sharp bend and move the guide tube It can be automatically retracted to a location associated with a sharp bend. With the tip retracted to that location, the needle can be inserted into or removed from the catheter. The control system may automatically move the catheter between the target configuration and the retracted configuration of the guide tube.肺カテーテルのようなフレキシブルなガイドチューブを備えるロボット医療システムが、標的構成におけるガイドチューブの形状を記録し得る。形状が、生検針のようなツールの挿入又は取外しのための最も鋭利な許容される屈曲よりも鋭利な屈曲を含むならば、制御システムは、鋭利な屈曲のあらゆる場所を見出して、ガイドチューブを鋭利な屈曲と関連付けられる場所まで自動的に後退させ得る。先端がその場所まで後退させられた状態で、針をカテーテル内に挿入し或いはカテーテルから取り外し得る。制御システムは、カテーテルをガイドチューブの標的構成と後退構成との間で自動的に動かし得る。