There would be a lateral displacement caused by the lateral force for complex curved surface structure during the pressure keeping process. A pressure keeping system consisted of laser displacement sensor and T-Mac was built, in order to measure the position of complex curved surface structure and compensate the error on-line. Coordinates of the actual measuring point were calculated based on angle approaching, whose normal direction was measured by three displacement sensors. The relative location to complex curved surface structure from the robot was provided by comparing the coordinates of the actual measuring point with the theoretical point. The position of the robot was given real-time by T-Mac. Then the absolute position of complex curved surface structure was obtained. The position correction of complex curved surface structure was realized by adjusting the robot end. The results of three times of online error compensation experiments show that the position deviation is close to 0.1mm and is decreased by 90% compares to the original error.