Programming device which generates operation program and method for generating program

A programming device capable of reducing the operator's work involved in generating an operation program for a robot. The programming device includes a model arrangement section which places a workpiece model, a robot model, and an imaging section model in a virtual space, a target-portion extracting section which extracts a target portion of the workpiece model in accordance with a certain extraction condition, a simulating section which. moves the imaging section model or the workpiece model to an imaging position, and a program generating section which generates an operation program for causing the imaging section to capture the portion to be captured, based on positional data of the robot model when the robot model positions the imaging section model or the workpiece model at the imaging position.

RELATED APPLICATIONS

The present application claims priority to Japanese Application Number 2017-135717, filed on Jul. 11, 2017, the disclosure of which is hereby incorporated by reference herein in its entirety.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates to a programming device which generates an operation program and a method for generating a program.

2. Description of the Related Art

Techniques for automatically generating operation programs for robots are known (e.g., International Publication WO 2004-085120).

An operation program for causing a robot to move an imaging section or a workpiece and the imaging section to capture the workpiece may be generated. In this case, the operator's work involved in generating the operation program is preferably reduced.

SUMMARY OF INVENTION

In an aspect of the present disclosure, a programming device, which generates an operation program for moving an imaging section or a workpiece by a robot and imaging the workpiece by the imaging section, comprises a model arrangement section configured to arrange, in a virtual space, a workpiece model modeling the workpiece, a robot model modeling the robot, and an imaging section model modeling the imaging section; a target-portion extracting section configured to extract a target portion of the workpiece model, which corresponds to a portion of the workpiece to be imaged, in accordance with a predetermined extraction condition; a simulating section configured to move the imaging section model or the workpiece model by the robot model to an imaging position where the imaging section model is to image the target portion extracted by the target-portion extracting section; and a program generating section configured to generate an operation program for causing the imaging section to image the portion of the workpiece to be imaged, based on positional data of the robot model when the robot model positions the imaging section model or the workpiece model at the imaging position.

In another aspect of the present disclosure, a method of generating an operation program for moving an imaging section or a workpiece by a robot and imaging the workpiece by the imaging section, comprises arranging, in a virtual space, a workpiece model modeling the workpiece, a robot model modeling the robot, and an imaging section model modeling the imaging section; extracting a target portion of the workpiece model, which corresponds to a portion of the workpiece to be imaged, in accordance with a predetermined extraction condition; moving the imaging section model or the workpiece model by the robot model to an imaging position where the imaging section model is to image the extracted target portion; and generating an operation program for causing the imaging section to image the portion of the workpiece to be imaged, based on positional data of the robot model when the robot model positions the imaging section model or the workpiece model at the imaging position.

According to the present disclosure, since an operation program for a series of operations of a robot system can be taught independently of the operator's experience, the time taken to start up the system can be considerably reduced.

DETAILED DESCRIPTION

Embodiments of the present disclosure will be described in detail below with reference to the drawings. In various embodiments to be described below, similar elements are assigned the same reference numerals, and repetitive descriptions thereof will be omitted. Further, in the following description, the x-axis positive direction of a robot coordinate system CRis referred to as the rightward direction, the y-axis positive direction of the robot coordinate system CRis referred to as the rearward direction, and the z-axis positive direction of the robot coordinate system CRis referred to as the upward direction, for the sake of convenience.

A programming device10according to an embodiment will be described with reference toFIG. 1. The programming device10includes a processor12, a system memory14, a working memory16, an input/output interface (I/O interface)18, a data input section20, and a display22.

The processor12, is communicably connected to the system memory14, the working memory16, and the I/O interface18via a bus24, and executes various processes described later while communicating with these elements.

The system memory14is comprised of an electrically erasable programmable nonvolatile memory, such as an EEPROM®. The system memory14records constants, variables, set values, computer programs, etc., which are necessary to execute various processes described later, so as not to be lost when the programming device10is shut down.

The working memory16temporarily stores data necessary for the processor12to execute various processes. Further, the constants, variables, set values, computer programs, etc., recorded in the system memory14are appropriately loaded on the working memory16, wherein the processor12uses the data loaded on the working memory16in order to execute various processes.

The I/O interface18is communicably connected to the data input section20, and receives data from the data input section20in accordance with a command from the processor12. The I/O interface18is also communicably connected to the display22, and transmits image data to the display22in accordance with a command from the processor12.

The I/O interface18is comprised of e.g. an Ethernet port or a USB port, and may communicate with the data input section20and the display22by wire. Alternatively, the I/O interface18may wirelessly communicate with the display22and the data input section20via a wireless LAN such as Wi-Fi.

The data input section20is comprised of e.g. a keyboard, a touch panel, or a mouse, and the operator can input data by operating the data input section20. The data input section20transmits the input data to the processor12via the I/O interface18.

The display22is comprised of e.g. a CRT, a Liquid Crystal Display (LCD), or an organic EL display. The display22receives image data transmitted from the I/O interface18, and displays it as an image viewable for an operator.

The programming device10generates an operation program for moving an imaging section104and a workpiece150relative to each other by a robot102and imaging the workpiece150by the imaging section104.

An example of a robot system100in a real space will be described below with reference toFIG. 2. The robot system100includes a robot102and an imaging section104. The robot102is a vertical articulated robot, and includes a robot base106, a rotary body108, a robot arm110, and a wrist112. The robot base106is fixed on a floor of a work cell in the real space.

The rotary body108is mounted to the robot base106so as to be rotatable about the vertical axis. The robot arm110includes an upper arm116rotatably connected to the rotary body108, and a lower arm118rotatably connected to a distal end of the upper arm116. The wrist112is connected to a distal end of the lower arm118, and rotatably supports the imaging section104.

A robot coordinate system CRis set for the robot102. The robot102moves each movable component (i.e., the rotary body108, the upper arm116, the lower arm118, and the wrist112) thereof with reference to the robot coordinate system CR. For example, the z-axis of the robot coordinate system CRis arranged parallel to the vertical direction in the real space, and the rotary body108is rotated about the z-axis of the robot coordinate system CR.

A tool coordinate system CTis set for an end effector (in this embodiment, the imaging section104) of the robot102. The tool coordinate system CTdefines the position and orientation of the imaging section104in the robot coordinate system CR.

The robot102moves the rotary body108, the robot arm110, and the wrist112in the robot coordinate system CRso as to match the position and orientation of the imaging section104with those defined by the tool coordinate system CT.

The imaging section104is connected to a distal end of the wrist112. The imaging section104is comprised of e.g. a vision sensor, and includes an image sensor, such as a CCD or a CMOS, and an optical system, such as a focus lens. The imaging section104images an object such as a workpiece150to acquire an image thereof.

A sensor coordinate system CSis set for the imaging section104. For example, the z-axis direction of the sensor coordinate system CSis set to coincide with the visual line direction of the imaging section104. The visual line of the imaging section104coincides with the optical axis of light incident on the optical system of the imaging section104.

In this embodiment, the positional relationship between the tool coordinate system CTand the sensor coordinate system CSis predetermined and known in advance. More specifically, the x-y planes of the tool coordinate system CTand the sensor coordinate system CSare parallel to each other.

The robot system100respectively images portions of the workpiece150by the imaging section104. In the example illustrated inFIG. 2, the workpiece150includes a main body152and parts154,156,158,160,162,164, and166projecting from the main body152.

More specifically, the main body152has an upper face168, and a rear face170and a right face172which are perpendicular to the upper face168and extend downwards from the upper face168. The parts154,156, and158project upward from the upper face168. The parts160and162project rearward from the rear face170. The parts164and166project rightward from the right face172.

Below, a case will described in which the operator sets only the parts154,156,158, and160of the parts154,156,158,160,162,164, and166as portions to be imaged by the imaging section104.

The robot102images the parts154,156,158, and160by the imaging section104in a predetermined order. As an example, the robot102moves the imaging section104so as to position the imaging section104at a first imaging position with respect to the workpiece150.

When the imaging section104is arranged at the first imaging position with respect to the workpiece150, the part154is within the field of view of the imaging section104such that the imaging section104can image the part154. Then, the imaging section104images the part154.

Then, the robot102moves the imaging section104so as to position the imaging section104at a second imaging position with respect to the workpiece150. When the imaging section104is arranged at the second imaging position with respect to the workpiece150, the part156is within the field of view of the imaging section104such that the imaging section104can image the part156. Then, the imaging section104images the part156.

Then, the robot102moves the imaging section104so as to position the imaging section104at a third imaging position with respect to the workpiece150. When the imaging section104is arranged at the third imaging position with respect to the workpiece150, the part158is within the field of view of the imaging section104such that the imaging section104can image the part158. Them, the imaging section104images the part158.

Then, the robot102moves the imaging section104so as to position the imaging section104at a fourth imaging position with respect to the workpiece150. When the imaging section104is arranged at the fourth imaging position with respect the workpiece150, the part160is within the field of view of the imaging section104such that the imaging section104can image the part160. Then, the imaging section104images the part160.

In this way, the robot system100carries out a series of operations, i.e., sequentially moving the imaging section104by the robot102, and sequentially imaging the parts154,156,158, and160as the portions to be imaged, by the imaging section104.

The programming device10according to this embodiment generates an operation program for such a series of operations of the robot system100. An exemplary function of the programming device10will be described below with reference toFIG. 3. The flow illustrated inFIG. 3is started when the programming device10is activated.

In step S1, the processor12arranges a workpiece model150M, a robot model102M, and an imaging section model104M in a virtual space200.FIG. 4illustrates an example of the virtual space200in this case.

Note that, in this specification, if a component in the real space is referred to as “XX,” a model of this component in the virtual space200will be referred to as “XX model.” For example, a model of “robot base” in the real space is referred to as “robot base model.” In this embodiment, all “XX models” are three dimensional.

The processor12arranges the robot model102M in the virtual space200in accordance with the input operation by the operator. The robot model102M is three-dimensional Computer Graphics (CG) which models the robot102illustrated inFIG. 2, and includes a robot base model106M, a rotary body model108M, a robot arm model110M, and a wrist model112M.

As an example, the system memory14pre-stores different types of robot models, including the robot model102M. The processor12generates image data showing the different types of robot models stored in the system memory14in the form of a list, and displays it on the display22. The operator operates the data input section20so as to select a desired robot model from the list displayed on the display22.

If the operator selects the robot model102M illustrated inFIG. 4, the data input section20transmits the data input by the operator to the processor12via the I/O interface18.

The processor12reads out the robot. model102M from the different types of robot models stored in the system memory14in accordance with the received input data, and arranges it in the virtual space200. Then, the processor12sets a robot coordinate system CRand a tool coordinate system CTfor the robot model102M, at positions similar to those inFIG. 2.

Similarly, the processor12arranges the imaging section model104M in the virtual space200in accordance with the input operation by the operator. The imaging section model104M is three-dimensional CG which models the imaging section104illustrated inFIG. 2.

As an example, the system memory14pre-stores different types of imaging section models, including the imaging section model104M. The processor12generates image data showing the different types of imaging section models stored in the system memory14in the form of a list, and displays it on the display22. The operator operates the data input section20so as to select a desired imaging section model from the list displayed on the display22.

If the operator selects the imaging section model104M illustrated inFIG. 4, the processor12reads out the imaging section model104M from the different types of imaging section models stored in the system memory14, in accordance with the input data received from the data input section20via the I/O interface18, and arranges it in the virtual space200.

At this time, the processor12arranges the imaging section model104M at the distal end of the wrist model112M so as to correspond to the mount position of the real imaging section104. Then, the processor12sets a sensor coordinate system CSfor the imaging section model104M at a position similar to that inFIG. 2.

Similarly, the processor12arranges the workpiece model150M in the virtual space200in accordance with the input operation by the operator. As an example, the system memory14pre-stores different types of workpiece models, including the workpiece model150M.

The processor12generates image data showing the different types of workpiece models stored in the system memory14in the form of a list, and displays it on the display22. The operator operates the data input section20so as to select a desired workpiece model from the list displayed on the display22.

When the operator selects the workpiece model150M illustrated inFIG. 4, the processor12reads out the workpiece model150M from the different types of workpiece models stored in the system memory14, in accordance with the input data received from the data input section20via the I/O interface18, and arranges it in the virtual space200.

The workpiece model150M is three dimensional CG which models the workpiece150illustrated inFIG. 2, and includes a main body model152M and part models154M,156M,158M,160M,162M,164M, and166M.

Then, the processor12sets a workpiece coordinate system CWfor the workpiece model150M. In the example illustrated inFIG. 4, the workpiece coordinate system CWis set such that the origin thereof is positioned at the left rear corner of an upper face model168M of the main body model152M, the x-y plane thereof is parallel to the upper face model168M, the x-z plane thereof is parallel to a rear face model170M, and the y-z plane thereof is parallel to a right face model172M.

In the example illustrated inFIG. 4, the part models154M,156M, and164M have a circular profile, the part models158M,160M, and166M have a quadrangular profile, and the part model162M has a triangular profile.

The sizes of the part models154M,156M,158M,160M,162M,164M, and166M are set such that the sizes of the part models154M and156M are set to “100,” those of the part models158M and166M are set to “300,” that of the part model160M is set to “150,” that of the part model162M is set to “80,” and that of the part model164M is set to “20.” These sizes may be expressed in units of e.g. m, m2, or m3.

The part model166M is painted in a color (i.e., black) different from those of the main body model152M and the part models154M,156M,158M,160M,162M, and164M. The operator can color any portion of the workpiece model150M, as the part model166M, by operating the data input section20.

In this way, a robot system model100M including a robot model102M and an imaging section model104M, and a workpiece model150M are arranged in the virtual space200, as illustrated inFIG. 4.

Thus, in this embodiment, the processor12functions as a model arrangement section26(FIG. 1) configured to arrange the workpiece model150M, the robot model102M, and the imaging section model104M in the virtual space200. The processor12generates the virtual space200as image data, and displays is on the display22as an image of the virtual space200as illustrated inFIG. 4.

In step S2, the processor12receives an extraction condition. The extraction condition is for specifying a portion to be extracted when extracting a target portion from the workpiece model150M in step S3described later.

The “target portion” in the present disclosure indicates a portion (i.e., the part models154M,156M,158M, and160M) of the workpiece model150M, which corresponds to a portion of the workpiece150to be imaged (i.e., the parts154,156,158, and160) by the imaging section104in the real space.

In this embodiment, the extraction condition includes a first condition for specifying the shape, the color, and the size of the target portion. As an example, the processor12generates image data showing fields of “Shape,” “Color,” and “Size” of the target portion, and displays it on the display22.

The operator operates the data input section20so as to input the shape of the target portion to be extracted in following step S3into the “Shape” field, as e.g. “Circular,” “Triangular,” or “Quadrangular”.

The operator operates the data input section20so as to input the color of the target portion to be extracted in following step S3into the “Color” field, as e.g. “White,” “Black,” or “Blue”.

The operator operates the data input section20so as to input the range of the sizes of the target portion to be extracted in following step S3into the “Size” field, as e.g. “100 to 200”. The operator can thus input a first condition for specifying a target portion on the workpiece model150M to be extracted.

Further, in this embodiment, the extraction condition includes a second condition for specifying the shape, the color, or the size of a portion of the workpiece model150M, which corresponds to a portion of the workpiece150not to be imaged by the imaging section104in the real space.

As an example, the processor12generates Image data showing fields of “Shape,” “Color,” and “Size” of a portion to be excluded from an imaging-target, and displays it on the display22. The operator operates the data input section20so as to input the shape of the portion not to be extracted in following step S3into the “Shape” fields, as e.g. “Circular,” “Triangular,” or “Quadrangular”.

The operator operates the data input section20so as to input the color of the portion not to be extracted in step S3into the “Color” field, as e.g. “White,” “Black,” or “Blue”.

The operator operates the data input section20so as to input the range of the size of the portion not to be extracted in step S3into the “Size” field, as e.g. “500 to 600”. In this way, the operator can input the second condition for specifying the portion of the workpiece model150M not to be extracted.

Below, a case is described in which the operator inputs “Circular” and “Quadrangular” into the “Shape” field, and “90 to 350” into the “Size” field, as the first condition of the extraction condition, while the operator inputs “Black” into the “Color” field as the second condition of the extraction condition.

The data input section20receives the input of the extraction condition from the operator, and transmits it to the processor12via the I/O interface18. The processor12stores the received extraction condition in the system memory14. Thus, in this embodiment, the data input section20functions as an extraction condition receiving section28(FIG. 1) configured to receive the input of the extraction condition.

In step S3, the processor12extracts a target portion in accordance with the extraction condition received in step S2. More specifically, the processor12refers to the first condition (i.e., “Shape”=“Circular” or “Quadrangular” and “Size”=“90 to 350”) included in the extraction condition received in step S2, and extracts a portion of the workpiece model150M, which matches the first condition, as the target portion.

In the workpiece model150M illustrated inFIG. 4, the part models154M,156M, and164M have a “Circular” shape, and the part models158M,160M, and166M have a “Quadrangular” shape. Further, in the workpiece model150M, the part models154M,156M,158M,160M, and166M have a size of “90 to 350.”

Therefore, the part models154M,156M,158M,160M, and166M of the workpiece model150M match the first condition of the extraction condition.

On the other hand, the processor12refers to the second condition (i.e., “Color”=“Black”) included in the extraction condition received in step S2, and does not extract a portion of the workpiece model150M, which matches the second condition, as the target portion.

In the example illustrated inFIG. 4, the part model166M is painted in black by the operator. Therefore, the processor12excludes the part model166M from the target portion.

As a result, the processor12extracts the part models154M,156M,158M, and160M of the workpiece model150M as the target portions. The processor12can extract the target portions which match the extraction condition from the workpiece model150M by comparing drawing data (e.g., 3D CAD data) of the workpiece model150M with the extraction condition.

Thus, in this embodiment, the processor12functions as a target-portion extracting section30(FIG. 1) configured to extract the target portions154M,156M,158M, and160M in accordance with the extraction condition.

In step S4, the processor12calculates an imaging position. More specifically, the processor12calculates, as a first imaging position, the position of the imaging section model104M with respect to the workpiece model150M, where the target portion154is within the field of view of the imaging section model104M.

The real imaging section104has a field of view indicating the range can be imaged, and a height of the field of view.FIG. 5represents a field of view A of the imaging section model104M, which corresponds to the field of view of the imaging section104. The size of the field of view A and the height B of the field of view of the imaging section model104M can be defined by e.g. the number of pixels of the image sensor and the specifications of the optical system of the real imaging section104.

Alternatively, the operator may designate the size of the field of view A and the height B of the field of view of the imaging section model104M in advance, by operating the data input section20. In this embodiment, the height B of the field of view coincides with the distance between the center of the field of view A and the origin of the sensor coordinate system CS.

The processor12calculates, as the first imaging position, the relative position of the workpiece model150M and the imaging section model104M illustrated inFIG. 5. When the workpiece model150B and the imaging section model104M are arranged at the first imaging position as illustrated inFIG. 5, the visual line O (i.e., the z-axis of the sensor coordinate system) of the imaging section model104M passes through the center C1of the target portion154M.

In addition, the distance between the imaging section model104M and the target portion154M in the direction of the visual line O coincides with the height B of the field of view. In addition, the x-y plane of the sensor coordinate system CS(i.e., the x-y plane of the tool coordinate system CT) is parallel to that of the workpiece coordinate system.

The processor12calculates the position of the center C1in the robot coordinate system CR, based on the position of the workpiece coordinate system CWin the robot coordinate system CRand the position of the center C1in the workpiece coordinate system CW. Then, the processor12calculates the position and orientation (i.e., the origin position and the direction of each axis) of the sensor coordinate system CScorresponding to the first imaging position, based on the calculated position of the center C1and the height B of the field of view.

Similarly, the processor12calculates, as a second imaging position, the position of the imaging section model104M with respect to the workpiece model150M, where the target portion156M is within the field of view A of the imaging section model104M.

When the workpiece model150M and the imaging section model104M are arranged at the second imaging position, the visual line O of the imaging section model104M passes through the center C2of the target portion156M, and the distance between the imaging section model104M and the target portion156M in the direction of the visual line O coincides with the height B of the field of view. In addition, the x-y planes of the sensor coordinate system CSand the workpiece coordinate system CWare parallel to each other.

The processor12calculates, as a third imaging position, the position of the imaging section model104M with respect to the workpiece model150M, where the target portion158M is within the field of view A of the imaging section model104M.

When the workpiece model150M and the imaging section model104M are arranged at the third imaging position, the visual line O of the imaging section model104M passes through the center C3of the target portion158M, and the distance between the imaging section model104M and the target portion158M in the direction of the visual line O coincides with the height B of the field of view. In addition, the x-y planes of the sensor coordinate system CSand the workpiece coordinate system CWare parallel to each other.

The processor12calculates, as a fourth imaging position, the position of the imaging section model104M with respect to the workpiece model150M, where the target portion160M is within the field of view A of the imaging section model104M.

When the workpiece model150M and the imaging section model104M are arranged at the fourth imaging position, the visual line O of the imaging section model104M passes through the center C4of the target portion160M, and the distance between the imaging section model104M and the target portion160M in the direction of the visual line O coincides with the height B of the field of view. In addition, the x-y plane of the sensor coordinate system CSis parallel to the x-z plane of the workpiece coordinate system CW.

In this way, the processor12calculates the nthimaging position (n=1, 2, 3, 4) corresponding to all the target portions154M,156M,158M and160M extracted in step S3, and stores them in the system memory14. Therefore, in this embodiment, the processor12functions as an imaging-position calculating section32(FIG. 1) configured to calculate the imaging position.

The operator may pre-set the condition of the nthimaging position (i.e., the condition that the visual line O of the imaging section model104M passes through the center Cn, that the distance between the imaging section model104M and the target portion154M coincides with the height B of the field of view, or that the plane defined by the sensor coordinate system CSis parallel to that defined by the workpiece coordinate system CW) by operating the data input section20.

In step S5, the processor12simulates an operation of positioning the imaging section model104M at the nthimaging position with respect to the workpiece model150M. Step S5will be described below with reference toFIG. 6. In step S11, the processor12sets the number “n” for specifying the imaging position to “1.”

In step S12, the processor12positions the imaging section model104M and the workpiece model150M at the nthimaging position. If n=1 is set at the start of step S12, the processor12simulatively operates the robot model102M so as to move the imaging section model104M in the virtual space200, and positions the imaging section model104M at the first imaging position with respect to the workpiece model150M. As a result, the imaging section model104M is positioned at the first imaging position with respect to the workpiece model150M as illustrated inFIG. 5.

In step S13, the processor12acquires nthpositional data of the robot model102M when the imaging section model104M is positioned at the nthimaging position with respect to the workpiece model150M in step S12.

As an example, the processor12acquires, as nthpositional data, data of the position and orientation (i.e., the origin position and the direction of each axis) of the tool coordinate system CTin the robot coordinate system CRwhen the imaging section model104M is positioned at the nthimaging position with respect to the workpiece model150M, and stores it in the system memory14.

Alternatively, the processor12acquires, as nthpositional data, the rotation angle of each movable component model (i.e., the rotary body model108M, an upper arm model116M, a lower arm model118M, and the wrist model112M) of the robot model102M when the imaging section model104M and the workpiece model150M are positioned at the nthimaging position, and stores it in the system memory14.

In step S14, the processor12increments the number “n” for specifying the imaging position by “1” (i.e., n=n+1).

In step S15, the processor12determines whether the number “n” for specifying the imaging position is larger than nD, where nDis the number of the target portions extracted in step S3. In this embodiment, nD=4.

When the number “n” is larger than nD(i.e., n>nD), the processor12determines YES, ends step S5illustrated inFIG. 6, and advances to step S6illustrated inFIG. 3. On the other hand, when the number “n” is equal to or less than nD(i.e., n≤nD), the processor12determines NO and returns to step S12. In this way, the processor12carries out the loop of steps S12to S15until it determines YES in step S15.

In this manner, the processor12simulates the operation of positioning the imaging section model104M at the nthimaging position with respect to the workpiece model150M, and acquires nthpositional data of the robot model102M when positioning the imaging section model104M at nthimaging position. Therefore, the processor12functions as a simulating section34(FIG. 1) configured to simulate the positioning operation.

Referring again toFIG. 3, in step S6, the processor12generates an operation program for the robot system100, based on the nthpositional data (n=1 to 4) acquired in step S13. More specifically, the processor12determines the nthpositional data as a teaching point at which the real robot102is to be positioned, thereby generates an operation program of a series of operations of the real robot system100as described above.

The operation program causes the real robot102to carry out the same operation as that of positioning the imaging section model104M at the nthimaging position relative to the workpiece model150M in the simulation in step S5. Accordingly, the robot102can position the imaging section104at the nthimaging position with respect to the workpiece150.

Further, the operation program causes the imaging section104to carry out an imaging operation to image the part154,156,158, or160of the workpiece150, which are to be imaged, each time the robot102positions the imaging section104at the nthimaging position relative to the workpiece150. In this way, it is possible to acquire the images of the parts154,156,158, and160to be imaged.

As described above, in this embodiment, the processor12automatically extracts the target portions (154M,156M,158M, and160M) on the workpiece model150M (step S3), and simulates the positioning operation to the extracted target portion (step S5).

Then, the processor12automatically acquires nthpositional data in the simulation (step S13), and generates the operation program for the real robot system100using the nthpositional data.

According to this configuration, it is possible to carry out teaching for the operation program of a series of operations of the robot system100without depending on the operator's experience, the time taken to start up the system can be considerably reduced.

Further, in this embodiment, the extraction condition includes the first condition for specifying the shape, the color, and the size of the target portion (154M,156M,158M,160M). According to this configuration, the operator can easily select the portion of the workpiece model150M to be extracted, by designating its shape, color, and size.

Further, in this embodiment, the extraction condition includes the second condition for specifying the shape, the color, or the size of the portion of the workpiece model150M excluded from the target. According to this configuration, the operator can easily exclude the portion of the workpiece model150, that is not desired to be extracted, from the extraction target, by designating its shape, color, and size.

For example, by painting the portion of the workpiece model150M not to be extracted in a specific color and designating this specific color as the “Color” in the second condition of the extraction condition, the operator can easily exclude the portion from the extraction target.

Further, in this embodiment, the programming device10includes the data input section20functioning as the extraction condition receiving section28which receives the input of the extraction condition. According to this configuration, since the operator can arbitrary set and input the extraction condition, it is possible to easily designate the target portion in detail.

Further, in this embodiment, the processor12calculates the nthimaging position (step S4). According to this configuration, since it is not necessary for the operator to manually designate the nthimaging position and thereby it is possible to automatically calculate the nthimaging position, the time taken to start up the system can be effectively reduced.

Next, another function of the programming device10is described with reference toFIGS. 7 to 10.FIG. 7is a block diagram illustrating another function of the programming device10. In this embodiment, the processor12further functions as a determination section38, an imaging-position searching section40, and a first imaging-position correcting section42.

Below, the function of the programming device10according to this embodiment will be described with reference toFIG. 8. Note that, inFIG. 8, processes similar as those in the flow illustrated inFIG. 3are assigned the same step numbers, and repetitive descriptions thereof will be omitted.

After step S4, in step S21, the processor12sets a movement path when the robot model102M moves the imaging section model104M to each of the first to nthimaging positions with respect to the workpiece model150M in the simulation carried out in step S22described later.

The technical meaning of step S21will be described below. In an actual manufacturing site, in order to reduce the cycle time, the imaging-target portions may be imaged by the imaging section104while the robot102is moving the imaging section104. In this case, it is necessary to set the movement path of the imaging section104by the robot102so as to be smoothly continuous (i.e., without discontinuous sharp corner in the movement path).

In this embodiment, the processor12changes each of the first to nthimaging positions calculated in step S4to new position so as to set a smoothly-continuous movement path when the imaging section model104M is continuously moved to the first imaging position, the second imaging position, . . . the nth imaging position by the robot model102M in the simulation carried out in step S22described later.

In step S22, the processor12simulates an operation of positioning the imaging section model104M at the nthimaging position with respect to the workpiece model150M. Step S22will be described below with reference toFIG. 9. Note that, in the flow illustrated inFIG. 9, processes similar as those inFIG. 6are assigned the same step numbers, and repetitive descriptions thereof will be omitted.

After step S12, in step S23, the processor12acquires a virtual image. More specifically, the processor12generates a virtual image which is within the field of view A of the imaging section model104M when the robot model102M positions the imaging section model104M at the nthimaging position with respect to the workpiece model150M.

In this step S23, the processor12may generate the virtual image while the robot model102M is moving the imaging section model104M in step S12.

FIGS. 10 and 11illustrate virtual images which fall within the field of view A of the imaging section model104M when the imaging section model104M is positioned at the first imaging position relative to the workpiece model150M. For the sake of easy understanding,FIGS. 10 and 11represent the visual line O of the imaging section model104M and the center C1of the target portion154M.

In a virtual image202illustrated inFIG. 10, the target portion154M is shifted from the center of the virtual image202to leftward in the drawing, and a part of the target portion154M is out of the virtual image202.

Accordingly, in this case, when the imaging section model104M is positioned at the first imaging position relative to the workpiece model150M, the visual line O of the imaging section model104M does not coincide with the center C1of the target portion154M, and a part of the target portion154M is out of the field of view A of the imaging section model104M.

On the other hand, in a virtual image204illustrated inFIG. 11, although the target portion154M is shifted from the center of the virtual image204to leftward, the entirety of the target portion154M is within the virtual image202.

Accordingly, in this case, when the imaging section model104M is positioned at the first imaging position relative to the workpiece model150M, the visual line O of the imaging section model104M does not coincide with the center C1of the target portion154M, but the entirety of the target portion154M is within the field of view A of the imaging section model104M.

Such situations, in which the visual line O of the imaging section model104M is shifted from the center C1of the target portion154M, may occur by changing the nthimaging position in above-mentioned step S21. In this step S23, the processor12generates the virtual image, such as the virtual image202or204, and stores it in the system memory14.

In step S24, the processor12determines whether the target portion154M,156M,158M, or160M is within the field of view A when the imaging section model104M and the workpiece model150M are positioned at the nthimaging position in step S12.

If n=1 is set at the start of step S24, the processor12analyzes the virtual image acquired in step S23and extracts the contour of the target portion154M shown therein.

On the other hand, the processor12reads out the drawing data of the workpiece model150M from the system memory14and acquires from the drawing data the shape of the part model154M (e.g., the contour shape of an upper face model of the part model154M) of the target portion.

Then, the processor12determines whether the shape of the contour of the target portion154M shown in the virtual image coincides with that of the part model154M of the drawing data. When the shape of the target portion154M shown in the virtual image coincides with that in the drawing data, the processor12determines that the target portion154M is within the field of view A (i.e., determines YES), and advances to step S26.

On the other hand, when the shape of the target portion154M shown in the virtual image does not coincide with that in the drawing data, the processor12determines that the target portion154M is out of the field of view A (i.e., determines NO), and advances to step S25.

For example, in the case of the virtual image202illustrated inFIG. 10, the shape of the contour of the target portion154M shown in the virtual image is a partially-cut circle, and does not coincide with that (i.e., a perfect circle) of the part model154M in the drawing data. Therefore, if the processor12acquires the virtual image202in step S23, it determines NO in step S24.

On the other hand, in the case of the virtual image204illustrated inFIG. 11, the shape of the contour of the target portion154M shown in the virtual image is a perfect circle and coincides with that of the part model154M in the drawing data. Therefore, if the processor12acquires the virtual image204in step S23, it determines YES in step S24.

It should be noted that the processor12may calculate the degree of similarity between the shape of the contour of the target portion154M shown in the virtual image and that of the part model154M in the drawing data, and determine YES when the degree of similarity is equal to or higher than a predetermined threshold. The degree of similarity is a parameter representing the degree of similarity between two shapes, and includes e.g. the area ratio between two shapes.

In this manner, in this embodiment, the processor12functions as a determination section38(FIG. 7) configured to determine whether or not the target portion154M,156M,158M, or160M is within the field of view A.

In step S25, the processor12executes a search and correction scheme for the nthimaging position. Step S25will be described below with reference toFIG. 12.

In step S27, the processor12changes the nthimaging position. More specifically, the processor12changes the nthimaging position set at the start of step S25to the relative position between the imaging section model104M and the workpiece model150M, where the imaging section model104M arranged at the original nthimaging position is shifted by a predetermined distance δ1in the x-axis, y-axis, or z-axis direction of the tool coordinate system CT.

In this way, the processor12can change the original nthimaging position set at the start of step S25to a new nthimaging position. At the changed nthimaging position, the imaging section model104M is shifted from the original nthimaging position before the change by the distance δ1in the x-axis, y-axis, or z-axis direction of the tool coordinate system CT.

In step S28, the processor12carries out again the operation of positioning the imaging section model104M at the nthimaging position with respect to the workpiece model150M. More specifically, the processor12returns the position of the imaging section model104M to an intermediate position in the movement path heading for the nthimaging position, in the virtual space200.

Then, the processor12simulates the operation of moving and positioning the imaging section model104M by the robot model102M from the intermediate position to the changed nthimaging position.

In step S29, the processor12acquires a virtual image again, similar as above-mentioned step S23.

In step S30, the processor12determines whether the target portion154M,156M,156M, or160M shown in the virtual image acquired in step S29is within the field of view A, similar as above mentioned step S24.

When the processor12determines YES, it advances to step S31, while it returns to step S27when determining NO. The processor12thus carries out the loop of steps S27to S30until it determines YES in step S24.

By repeatedly executing steps S27to S30in this way, the processor12searches the relative position of the imaging section model104M and the workpiece model150M, where the target portion154M,156M158M, or160M is within the field of view A. Therefore, in this embodiment, the processor12functions as an imaging-position searching section40(FIG. 7) configured to search this relative position.

In this connection, when the processor12changes the nthimaging position in step S27until it determines YES in step S30, the processor12may shift the imaging section model104M in the x-axis, y-axis, and z-axis directions of the tool coordinate system CTin accordance with a predetermined order.

For example, the processor12may change the nthimaging position in the order in which the imaging section model104M is shifted in the x-axis direction by 10 times, then, shifted in the y-axis direction by 10 times, and then, shifted in the z-axis direction by 10 times, as the predetermined order.

Further, when the processor12changes the nthimaging position in step S27until it determines YES in step S30, a range [α, β], in which the imaging section model104M is to be shifted in each axis-direction of the tool coordinate system CT, may be set.

For example, if the range in which the imaging section model104M is to be shifted in the x-axis direction of the tool coordinate system CTis set to [−10, 10], the processor12shifts the imaging section model104M in the x-axis direction of the tool coordinate system CTfrom the nthimaging position set at the start of step S25, in the range of −10≤×≤10.

Further, when the processor12changes the nthimaging position in step S27until it determines YES in step S30, the processor12may receive valid or invalid setting of the changes to shift the imaging section model104M in the x-axis, y-axis, and z-axis directions of the tool coordinate system CT.

For example, when the change to shift in the z-axis direction is set to “Invalid,” the processor12does not shift the imaging section model104M in the z-axis direction of the tool coordinate system CTwhen changing the nthimaging position in step S27.

The above-mentioned predetermined order, the range [α, β], and the valid/invalid setting may be predetermined, or the processor12may receive input of the predetermined order, the range [α, β], and the valid/invalid setting from the operator via the data input section20.

In step S31, the processor12corrects the nthimaging position set at the start of step S25to that set at the time when the processor12determines YES in step S30, and stores it in the system memory14.

In this manner, in this embodiment, the processor12functions as a first imaging-position correcting section42(FIG. 7) configured to correct the nthimaging position, based on the relative position of the imaging section model104M and the workpiece model150M searched in steps S27to S30. Then, the processor12ends step S25illustrated inFIG. 12, and advances to step S13illustrated inFIG. 9.

As stated above, in this embodiment, when the target portion154M,156M,158M, or160M is out of the field of view A upon execution of step S23, the processor12searches the relative position of the imaging section model104M and the workpiece model150M, where the target portion154M,156M,158M, or160M falls within the field of view A (steps S27to S30), and corrects the nthimaging position based on this relative position (step S31).

According to this configuration, if the movement path to move the imaging section model104M by the robot model102M is set to a smooth path (step S21), it is possible to acquire the nthimaging position where the target portion154M,156M,158M, or160M reliably falls within the field of view A.

Accordingly, it is possible to effectively generate the operation program for causing the real imaging section104to image the portion to be imaged while moving the imaging section104by the real robot102.

Next, still another function of the programming device10will be described with reference toFIGS. 13 to 17.FIG. 13is a block diagram illustrating still another function of the programming device10. In this embodiment, the processor12further functions as an interference detecting section44, a noninterference-position searching section46, and a second imaging-position correcting section48.

The function of the programming device10according to this embodiment will be described below with reference toFIG. 14. Note that, inFIG. 14, processes similar as the flow illustrated inFIG. 3are assigned the same step numbers, and repetitive descriptions thereof will be omitted.

In step S41, the processor12functions as the model arrangement section26and arranges the workpiece model150M, the robot model102M, the imaging section model104M, and an environmental object model206M in the virtual space200.FIG. 15illustrates an example of the virtual space200in this case. The environmental object model206M is three-dimensional CG modeling an object, such as a pillar or wall of a work cell, which is present around the robot system100and the workpiece150.

After step S4, in step S42, the processor12simulates an operation for positioning the imaging section model104M at the nthimaging position relative to the workpiece model150M. Step S42will be described below with reference toFIG. 16. In the flow illustrated inFIG. 16, processes similar as those inFIG. 6are assigned the same step numbers, and repetitive descriptions thereof will be omitted.

After step S12, in step S43, the processor12determines whether interference is detected between the robot model102M or the imaging section model104M and the workpiece model150M or the environmental object model206M.

More specifically, the processor12determines whether the interference occurs between the robot model102M or the imaging section model104M and the workpiece model150M or the environmental object model206M, based on e.g. the drawing data of the robot model102M, the imaging section model104M, the workpiece model150M, and the environmental object model206M, and positional data of these elements in the robot coordinate system CR.

When the processor12determines that the interference occurs between the robot model102M or the imaging section model104M and the workpiece model150M or the environmental object model206M (i.e., determines YES), it advances to step S44.

On the other hand, when the processor12determines that no interference occurs between the robot model102M or the imaging section model104M and the workpiece model150M or the environmental object model206M (i.e., determines NO), it advances to step S13.

Thus, in this embodiment, the processor12functions as an interference detecting section44(FIG. 13) configured to detect the interference between the robot model102M or the imaging section model104M and the workpiece model150M or the environmental object model206M.

In step S44, the processor12executes a scheme of noninterference-position search and imaging position correction. Step S44will be described below with reference toFIG. 17.

In step S45, the processor12changes the relative position of the imaging section model104M and the workpiece model150M arranged at the nthimaging position in step S12. More specifically, the processor12shifts the imaging section model104M by a predetermined distance δ2in the x-axis, y-axis, or z-axis direction of the tool coordinate system CT.

Alternatively, the processor12rotates the imaging section model104M about the x-axis or y-axis of the tool coordinate system CT(or the sensor coordinate system CS) by a predetermined angle θ. In this way, the processor12can change the position of the imaging section model104M by the distance δ2or the angle θ.

In this connection, the processor12changes the position of the imaging section model104M in this step S45such that the target portion154M,156M,158M, or160M falls within the field of view A. For example, the processor12changes the position of the imaging section model104M such that the visual line O of the imaging section model104M intersects with. the center Cnof the target portion154M,156M,158M, or160M (or any point on the target portion).

In step S46, the processor12determines whether the interference is detected between the robot model102M or the imaging section model104M and the workpiece model150M or the environmental object model206M, similarly as step S43.

When the processor12determines YES, it advances to step S47, while it returns to step S45when determining NO. In this way, the processor12carries out the loop of steps S45and S46until it determines YES in step S46.

When it is determined YES in step S46, the robot model102M or the imaging section model104M is placed at a non-interference position where it does not interfere with the workpiece model150M or the environmental object model206M.

By repeatedly executing steps S45and S46in this way, the processor12searches the non-interference position where the above-mentioned interference does not occur. Therefore, in this embodiment, the processor12functions as a noninterference-position searching section46(FIG. 13) configured to search the non-interference position.

In this connection, when the processor12repeatedly executes step S45until it determines YES in step S46, the processor12may carry out the operations to shift the imaging section model104M in the x-axis, y-axis, and z-axis directions of the tool coordinate system CT, and rotate the imaging section model104M about the x-axis or y-axis of the tool coordinate system CT(or the sensor coordinate system CS), in accordance with a predetermined order.

Further, when the processor12repeatedly executes step S45until it determines YES in step S46, a range [γ, ϵ], in which the imaging section model104M is to be moved in the direction of or about each axis of the tool coordinate system CT, may be set.

For example, when the range in which the imaging section model104M is to be rotated about the y-axis of the sensor coordinate system. CSis set to [−10°, 10°], in step S45, the processor12rotates the imaging section model104M about the y-axis of the sensor coordinate system CSfrom the position set at the start of step S25, in the range of −10°≤×≤10°.

The processor12may receive valid or invalid setting of the operation of shifting the imaging section model104M in the x-axis, y-axis, or z-axis direction of the tool coordinate system CT, or rotating the imaging section model104M about the x-axis or y-axis of the tool coordinate system CT(or the sensor coordinate system CS), when executing step S45.

For example, if the rotation about the y-axis of the sensor coordinate system CSis set to “Invalid,” the processor12does not carry out the rotation about the y-axis of the sensor coordinate system CSwhen executing step S45.

The predetermined order, the range [γ, ϵ], and the valid/invalid setting referred to in step S45may be predetermined, or the processor12may receive input of the predetermined order, the range [γ, ϵ], and the valid/invalid setting from the operator via the data input section20.

In step S47, the processor12corrects the nthimaging position set at the start of step S44to the relative position between the imaging section model104M and the workpiece model150M set at the time when the processor12determines YES in step S46, and stores it in the system memory14.

Thus, in this embodiment, the processor12functions as a second imaging-position correcting section48(FIG. 13) configured to correct the nthimaging position, based on the non-interference position searched in steps S45and S46. After step S47, the processor12ends step S44illustrated inFIG. 17, and advances to step S13illustrated inFIG. 16.

As described above, in this embodiment, the processor12searches the non-interference position where the interference detected in step S43does not occur (steps S45and S46), and generates an operation program using the nthimaging position corrected based on the non-interference position (step S6).

According to this configuration, it is possible to generate the operation program for a series of operations of imaging the target portions154M,156M,158M, and160M by the imaging section104so as to prevent the interference between the robot102or the imaging section104and the workpiece150or the environmental object in an environment of a real space where an environmental object is present around the robot system100.

Next, still another function of the programming device10will be described with reference toFIGS. 18 and 19.FIG. 18is a block diagram illustrating still another function of the programming device10. In this embodiment, the processor12further functions as an imaging-timing setting section50.

The function of the programming device10according to this embodiment will be described below with reference toFIG. 19. Note that, inFIG. 19, processes similar as those inFIG. 3are assigned the same step numbers, and repetitive descriptions thereof will be omitted.

After step S5, in step S51, the processor12sets a start time point tsand an end time point tefor an imaging operation by the real imaging section104. As an example, the processor12receives designation of a movement speed VRof the robot102when positioning the imaging section104at the nthimaging position relative to the workpiece150.

More specifically, the processor12generates image data which allow input of the movement speed VR, and displays it on the display22. The operator inputs a desired movement speed VRby operating the data input section20, and the processor12receives the movement speed VRvia the I/O interface18.

The processor12automatically sets the start time point tsand the end time point teof an imaging operation, based on the received movement speed VR. For example, the processor12sets the start time point tsto a time point t1sec before the imaging section104reaches the nthimaging position by the real robot102, while setting the end time point teto a time point t2sec after the imaging section104passes the nthimaging position by the robot102.

These times t1and t2can be calculated from the movement speed VRof the robot102. In this way, the processor12automatically sets the start time point tsand the end time point te, based on the movement speed VR.

As another example, the start time point tsand the end time point temay be arbitrarily designated by the operator. The processor12sets the start time point tsand the end time point tein accordance with the designation from the operator, and stores them in the system memory14. Thus, in this embodiment, the processor12functions as an imaging-timing setting section50configured to set the start time point tsand the end time point teof an imaging operation.

In step S52, the processor12generates an operation program for the robot system100, based on the nthpositional data (n=1 to 4) acquired in step S13(FIG. 6), and on the start time point tsand the end time point teset in step S51.

More specifically, the processor12generates an operation program for causing the imaging section104to carry out the imaging operation over a period T from the start time point tsto the end time point te(i.e., T=te−ts. For example, T=0.5 sec) set in step S51.

For example, the operation program is generated to start the imaging operation by the imaging section104(more specifically, to expose the image sensor to light by opening the shutter) at the time point ts, t1sec before the imaging section104reaches the nthimaging position by the robot102, and to end the imaging operation of the imaging section104(more specifically, to close the shutter) at the time point te, t2sec after the imaging section104passes the nthimaging position by the robot102.

According to this embodiment, it is possible reliably capture the portions to be imaged when the portions to be imaged are imaged by the imaging section104while moving the imaging section104by the robot102.

Next, still another function of the programming device10will be described with reference toFIGS. 20 to 23.FIG. 20is a block diagram illustrating still another function of the programming device10. In this embodiment, the processor12further functions as an order determination section52.

The function of the programming device10according to this embodiment will be described below with reference toFIG. 21. Note that, inFIG. 21, processes similar as those inFIG. 3are assigned the same step numbers, and repetitive descriptions thereof will be omitted.

After step S5, in step S60, the processor12executes a minimum movement path search scheme. Step S60will be described below with reference toFIG. 22.

In step S60illustrated inFIG. 22, a series of operations in steps S62, S11to S13, S15, and S63to S65inFIG. 22is repeatedly executed for the predetermined number of times μ, until it is determined YES in step S65described later. The number of times μ is predetermined (e.g., μ=50) by the operator, and stored in the system memory14.

In step S61, the processor12sets the number “m” for specifying the number of times, for which the series of operations in steps S62, S11to S13, S15, and S63to S65of step S60is executed, to “1.”

In step S62, the processor12determines the order in which the imaging section model104M and the workpiece model150M are positioned at the imaging positions calculated in step S4.

As described above, the first imaging position is set as a position Where the target portion154M is within the field of view A, the second imaging position is set as a position where the target portion156M is within the field of view A, the third imaging position is set as a position where the target portion158M is within the field of view A, and the fourth imaging position is set as a position where the target portion160M is within the field of view A.

Due to this arrangement, the processor12moves the imaging section model104M in the order of the first imaging position corresponding to the target portion154, the second imaging position corresponding to the target portion156, the third imaging position corresponding to the target portion158, and the fourth imaging position corresponding to the target portion160, in the simulation (step S5, S22, S42) for moving the imaging section model104M.

In this embodiment, in step S62, the processor12randomly determines this order. More specifically, the number “n” (=1 to 4) for specifying the imaging position is randomly assigned to the target portions154,156,158, and160.

For example, the processor12assigns the number “n” to the target portions154,156,158, and160so as to set the position where the target portion156M is within the field of view A as a first imaging position, set the position where the target portion160M is within the field of view A as a second imaging position, set the position where the target portion158M is within the field of view A as a third imaging position, and set the position where the target portion154M is within the field of view A as a fourth imaging position.

In this case, the processor12moves the imaging section model104M in the order of the first imaging position where the target portion156M is within the field of view A, the second imaging position where the target portion160M is within the field of view A, the third imaging position where the target portion158M is within the field of view A, and the fourth imaging position where the target portion154M falls within the field of view A, when carrying out the loop of steps S11, S12, S13, and S15in step S60.

Thus, in this embodiment, the processor12functions as the order determination section52configured to determine the order for positioning the imaging section model104M and the workpiece model150M at the imaging positions.

After step S62, the processor12sequentially executes steps S11, S12, S13, and S15, based on the number “n” determined in most-recent step S62, so as to sequentially position the imaging section model104M at the nthimaging position relative to the workpiece model150M.

When it is determined YES in step S15, in step S63, the processor12calculate the length Lmof the movement path (i.e., the path leading to the first imaging position, the second imaging position, . . . the nDthimaging position) along which the imaging section model104M is moved in the most-recent loop of steps S12, S13, and S15. The processor12stores the calculated length Lmin the system memory14.

In step S64, the processor12increments the number “m” by “1” (i.e., m=m+1).

In step S65, the processor12determines whether the number “m” is larger than μ. When the number “m” is larger than μ (i.e., m>μ), the processor12determines YES and advances to step S66.

When the number “m” is equal to or less than μ (i.e., m≤μ), the processor12determines NO and returns to step S62. The processor12thus carries out the loop of steps S62to S65until it determines YES in step S65, so as to sequentially acquire the lengths Lm(m=1, 2, 3, . . . μ) of the movement paths when the imaging section model104M is moved to the imaging positions in the order randomly determined in step S62.

In step S66, the processor12acquires a minimum movement path PMIN. More specifically, the processor12reads out from the system memory14the lengths L1to Lμof the movement paths acquired each time step S63is executed, and compares them with each other to acquire a movement path corresponding to the smallest of the lengths L1to Lμ, as the minimum movement path PMIN.

Then, the processor12ends step S60illustrated inFIG. 22, and advances to step S6inFIG. 21. Then, in step S6, the processor12generates an operation program for positioning the imaging section model104M and the workpiece model150M at the nthimaging position in the order corresponding to the minimum movement path PMINacquired in step S66.

According to this embodiment, the processor12can automatically generate the operation program for positioning the imaging section model104M and the workpiece model150M at each nthimaging position along the minimum movement path PMIN. Accordingly, it is possible to minimize the cycle time when the real robot system100is operated in accordance with the operation program.

Next, a programming device60according to another embodiment will be described with reference toFIG. 23. The programming device60includes a model arrangement section62, a target-portion extracting section64, a simulating section66, and a program generating section68.

The model arrangement section62arranges the workpiece model150M, the robot model102M, and the imaging section model104M in the virtual space200(step S1), similarly as the above mentioned model arrangement section26. The target-portion extracting section64extracts the target portions154M,156M,158M, and160M on the workpiece model150M in accordance with the predetermined extraction condition (step S3).

The simulating section66simulates positioning the imaging section model104M at the nthimaging position relative to the workpiece model150M (step S5), similarly as the simulating section34.

The program generating section68generates the operation program for the robot system100, based on positional data of the robot model102M acquired in the simulation carried out by the simulating section66(step S6), similarly as the program generating section36.

The programming device60may be comprised of a single computer including a processor and a memory (a system memory14or a working memory16). Alternatively, each of the model arrangement section62, the target-portion extracting section64, the simulating section66, and the program generating section68may be comprised of a single computer including a processor and a memory.

Note that, as the first or second condition of the extraction condition, a condition for specifying the name of a part model constituting the workpiece model150M may be added. In this case, the operator may register a name (e.g., “boss A” or “joint B”) for each part model by operating the data input section20.

The model arrangement section26,62may set and use a reference coordinate system CD, in addition to the robot coordinate system CR. The nthimaging position may be set such that the visual line O of the imaging section model104M passes through any point on the target portion.

In the above-described embodiments, the robot102(robot model102M) moves the imaging section104(imaging section model104M) so as to arrange at the imaging position relative to the workpiece150(workpiece model150M).

However, the workpiece150(workpiece model150M) may be moved by the robot102(robot model102M) and positioned at the imaging position relative to the imaging section104(imaging section model104M). In this case, the workpiece150(workpiece model150M) is connected to the wrist112(wrist model112M).

The features of the embodiments illustrated inFIGS. 1, 7, 13, 18, and 20may be combined with each other. For example, the interference detecting section44, the noninterference-position searching section46, and the second imaging-position correcting section48illustrated inFIG. 13may be added to the embodiment illustrated inFIG. 7. The robot102is not limited to a vertical multi-articulated robot, and may be e.g. a parallel-linkage robot or a loader.

While the present disclosure has been described above with reference to embodiments, the above-described embodiments do not limit the invention according to the scope of claims.