A visual sensor main body is attached to a first attachment provided in a
vicinity of a hand provided to a tip end of a robot arm to take an image
of a workpiece to obtain a position and an attitude of the workpiece.
Based on the detected position and attitude, the workpiece is grasped
with the hand. The sensor main body is handed to the second attachment
provided in the retreat position. Then, after mounting the grasped
workpiece to a chuck of a working machine and machining the workpiece,
the workpiece is taken out with the hand.