A method comprises measuring, with a sensor, a shape of a section of an elongated flexible instrument and comparing the measured shape of the section of the elongated flexible instrument to an expected shape. The method also comprises determining whether the measured shape of the section of the elongated flexible instrument differs from the expected shape by a predefined threshold.