A system and method for an integrated surgical table includes a medical device including an articulated arm having one or more first and second joints and a control unit. The articulated arm has at least a cannula, an endoscope, or an instrument mounted distal to the first and second joints, which is inserted into a patient at a body opening. The control unit unlocks the first joints, receives a surgical table movement request, determines whether the surgical table movement request should be granted, allows the surgical table to perform the requested movement based on the determining, uses the first joints to allow the articulated arm to track movement of the body opening based on forces applied by a body wall at the body opening, and compensates for changes in a pose of the cannula, endoscope, or instrument due to the tracked movement by performing compensating motions in the second joints.