A computer-assisted medical device (110, 210) comprising: an articulated arm comprising one or more first joints (223, 226, 242, 264) and one or more second joints (223, 226, 242, 264), the articulated arm configured to hold a tool distal to the one or more first joints (223, 226, 242, 264) and the one or more second joints (223, 226, 242, 264); and a control unit coupled to the one or more first joints (223, 226, 242, 264) and the one or more second joints (223, 226, 242, 264); characterized in that, during movement of the one or more first joints (223, 226, 242, 264), the control unit maintains a position and an orientation of the tool using the one or more second joints (223, 226, 242, 264) by: determining a reference coordinate frame (320, 330, 342, 352, 362) for the tool; determining a reference transform of the tool in the reference coordinate frame (320, 330, 342, 352, 362) prior to the movement of the one or more first joints (223, 226, 242, 264); determining an actual transform of the tool in the reference coordinate frame (320, 330, 342, 352, 362) while the one or more first joints (223, 226, 242, 264) are being moved; determining differences between the reference transform and the actual transform; and maintaining the position and orientation of the tool by driving the one or more second joints (223, 226, 242, 264) based on the differences. an articulated arm comprising one or more first joints (223, 226, 242, 264) and one or more second joints (223, 226, 242, 264), the articulated arm configured to hold a tool distal to the one or more first joints (223, 226, 242, 264) and the one or more second joints (223, 226, 242, 264); and a control unit coupled to the one or more first joints (223, 226, 242, 264) and the one or more second joints (223, 226, 242, 264); characterized in that, during movement of the one or more first joints (223, 226, 242, 264), the control unit maintains a position and an orientation of the tool using the one or more second joints (223, 226, 242, 264) by: determining a reference coordinate frame (320, 330, 342, 352, 362) for the tool; determining a reference transform of the tool in the reference coordinate frame (320, 330, 342, 352, 362) prior to the movement of the one or more first joints (223, 226, 242, 264); determining an actual transform of the tool in the reference coordinate frame (320, 330, 342, 352, 362) while the one or more first joints (223, 226, 242, 264) are being moved; determining differences between the reference transform and the actual transform; and maintaining the position and orientation of the tool by driving the one or more second joints (223, 226, 242, 264) based on the differences. determining a reference coordinate frame (320, 330, 342, 352, 362) for the tool; determining a reference transform of the tool in the reference coordinate frame (320, 330, 342, 352, 362) prior to the movement of the one or more first joints (223, 226, 242, 264); determining an actual transform of the tool in the reference coordinate frame (320, 330, 342, 352, 362) while the one or more first joints (223, 226, 242, 264) are being moved; determining differences between the reference transform and the actual transform; and maintaining the position and orientation of the tool by driving the one or more second joints (223, 226, 242, 264) based on the differences.