In order to realize the active heave compensation function of cranes for side-by-side replenishment of two ships,this article proposes a control method based on dynamic attitude measurement of the two ships.It also designs a control system based on this method for a 50 t active heave compensation crane.After the factory test and marine test,the compensation accuracy of the crane reached 95%.