A workpiece is gripped by a robot hand and an image of the workpiece is
captured by a camera. An image processing device detects the position and
posture of a characteristic portion of the workpiece. On the basis of the
present position of the robot, the relative position and posture between
a flange of the robot and the workpiece characteristic portion is
detected. The relative position and posture is compared with that
observed when the workpiece is gripped correctly, to determine a gripping
error. If the gripping error exceeds a permissible error, the robot is
stopped. If the gripping error is equal to or less than the permissible
error, a taught position where the workpiece is to be released is
corrected so as to cancel the adverse effect of the gripping error.