A robot system can grasp and take out one of a plurality of workpieces
placed in a basket-like container by a hand mounted at the forward end of
a robot arm. The workpiece is detected by a visual sensor, and the robot
is controlled depending on a position and an orientation of the
workpiece. When a problem such as interference or the like occurs,
information relating to the problem is stored in a robot control unit or
a visual sensor control unit. Information relating to the problem
includes a predetermined amount of the latest data retrospectively traced
from the time point of problem occurrence, a position which the robot has
reached, the target position data, the content of the process executed by
the visual sensor, and the detection result. When the problem is
reproduced, these data are used to simulate the situation at the time of
problem occurrence by using simulation unit. The situation at the time of
problem occurrence can also be reproduced by using the actual robot
without using the simulation unit.