An offline programming device 1, robot control units 2a and 3a, and visual
sensors 4 and 5 are connected to each other via a communication line 10.
The device 1 stores and displays a shape of a work 6 generated by a CAD,
for the work to be processed. Vertexes and edge lines of the work shape
are assigned. A straight line processing route is formed by connecting
between the assigned vertexes as teaching points. Points at both ends of
the assigned edge line are set as teaching points, and the assigned edge
line is set as a processing route. A processing program is generated in
this way. The processing program is corrected based on a position and a
posture of an actual work obtained by acquiring images of the work with
the visual sensors 4 and 5. The processing operation of the processing
program is simulated, and the work 6 is moved with a carriage 7 so that
each axis of the robot is within a stroke limit to avoid the occurrence
of interference between the robot and other objects. Alternatively,
postures of processing tools 8 and 9 are changed, thereby easily
generating the processing program. With this arrangement, the invention
provides a processing program generating device that can easily generate
a processing program for the robot, without interrupting the processing
and without requiring an expensive tool.