1. A computer-assisted medical device, the device comprising: an articulated arm comprising one or more first joints and one or more second joints; a tool distal to the one or more first joints and the one or more second joints; and a control unit coupled to the one or more first joints and the one or more second joints; wherein, during movement of the one or more first joints, the control unit: determines a reference coordinate frame for the tool; determines a reference transform of an initial position and orientation of the tool in the reference coordinate frame prior to the movement of the one or more first joints; determines an actual transform of a current position and orientation of the tool in the reference coordinate frame while the one or more first joints are being moved; determines differences between the reference transform and the actual transform; and maintains a position and orientation of the tool at the initial position and orientation in the reference coordinate frame by driving the one or more second joints based on the differences.