A kind of method and system: providing at least two light beams, and the light beam intersects at the remote centre of motion (RCM) of robot, and the robot has end effector in its distal end Capture the entrance of planning and the image in the path by the planning of RCM Captured image is registrated to three-dimensional pre-operative image The entrance and path for the RCM in the captured image are limited using light beam Detection and tracking has the references object of known form in the captured image In response to the information about the entrance, the path and the references object, the end effector is aligned by calculating robots joint kinematic parameter with the path of the entrance of the planning and the planning And it sends calculated joint of robot kinematic parameter to the robot, the end effector is snapped to the entrance of the planning and the path of the planning.