MotionWare With Vision Statements
The following statements are detailed in this section: INSPECT, PICTURE, REFINE_FRAME, and REFINE_TOOL. The statement SET_FRAME, detailed in MotionWare Statements, also has an optional vision argument.
INSPECT
The INSPECT statement causes evaluation of up to eight inspection records. The routine executes all --vision-- arguments regardless of pass/fail status. If one or more of the inspections fail, the OK_SIGNAL is set to FALSE. If all inspections pass, then the OK_SIGNAL is set to TRUE.
INSPECT OPERATION --vision-- { &--vision-- { &--vision-- {&--vision-- {& --vision-- { &--vision-- { &--vision-- _ &--vision--}}}}}}} {SAVE_PREVIOUS --yes/no--} {OK_SIGNAL --o_variable--}The --vision-- argument can be completed only with an Inspection record. An inspection record will appear in the pick list of available records only if TopLevel is selected in that record.
The one required argument for the INSPECT statement is the first vision argument (no brackets around the argument indicate it is a required argument). When this statement is executed, vision will take all the necessary pictures and evaluate all the necessary records to generate the value that the inspection record is to evaluate. (This statement will move the robot as necessary to take pictures, depending on the camera mounting and the parameters specified in the picture records.) The inspections are evaluated and the output variable, if defined, is set to TRUE (-1) if all the inspections succeed. Otherwise, it is set to FALSE (0). If Gather stats was selected in the inspection record, the values generated by the inspection are reported to the Inspection Results pages (see Inspection Results Page).
The optional arguments ({vision}) also require a top-level inspection record. Each of these records will be evaluated in the same manner as the required inspection record, as follows:
The inspection records are evaluated from left to right until all records are evaluated;
If an inspection fails, the entire statement will be considered to have failed, and the variable specified in {OK_SIGNAL--o_variable--} will be set accordingly.
If {SAVE_PREVIOUS} is omitted or set to "no", all pictures needed for the inspection are taken. If a vision record that requires movement of the robot is in the inspection tree, the robot will move. If this argument is set to "yes", the system assumes that all picture data is available and will not acquire new images (although it will wait for any in-progress image processing to complete). If any required image data is not available, the sequence will halt with the appropriate error.
PICTURE Statement
The PICTURE statement takes the pictures required for a vision operation and (if specified) moves the robot to a picture-taking location.
PICTURE FOR --vision-- {SINGLE_PICTURE --vision-- {SAVE_PREVIOUS --yes/no--}} {OK_SIGNAL --o_variable--}This statement takes pictures for the vision operation specified in the FOR --vision-- clause and the vision server begins computing the vision result. This statement does not wait for the vision result to be computed but completes as soon as all the requested pictures are taken.
The robot may be moved if the picture records specify robot motions.
If the SINGLE_PICTURE --vision-- clause is not specified, all pictures for the entire vision operation are taken.
The SINGLE_PICTURE clause is useful only in situations where the vision operation is based on more than one picture. If the SINGLE_PICTURE --vision-- clause is specified, its argument must be the name of a picture record in the vision database. This statement then takes only that picture and completes as soon as the picture is taken. In the background, the vision server computes any vision results that depend on that picture.
If the SAVE_PREVIOUS --yes/no-- clause is omitted or set to no, all previous vision data for the initial vision operation is cleared and recomputed.
If the SAVE_PREVIOUS --yes/no-- clause is set to yes, the vision data that depends on this picture is cleared, but the remaining data for the vision operation is not cleared. This setting is used after the first picture in a multiple-picture application.
If the OK_SIGNAL --o_variable-- clause is specified, the output variable is set to TRUE if the picture taking succeeded. Otherwise it is set to FALSE. This variable does not reflect the status of the entire vision operation.
See the VisionWare User's Guide for details on creating vision records.
Vision Inspection Using a Fixed-Mount Camera
To specify the motion information for a picture-taking location that is based on a fixed-mount camera:
Edit -> Vision
Seek -> Index -> double-click the picture record
If you want the robot to move as a part of the picture-taking operation, select Use it from the Motion group and click Setup .1
When the motion information pop-up window is displayed, select Object moved by robot and the following options are displayed:
Figure 9-5. Picture Record Motion Options (Fixed-Mount Camera)Vision Inspection Using an Arm-Mounted Camera
To specify the motion information for an arm-mounted camera:
Edit -> Vision
Seek -> Index -> double-click the picture recordIf you want the robot to move as a part of the picture-taking operation, select Use it from the Motion group and click Setup to define a path point or picture-taking location.2
Figure 9-6. Picture Record Motion Options (Arm-Mounted Camera)
If options are not available, they are not appropriate to the current camera calibration.
If the "Setup" button is not displayed, the camera is not correctly calibrated.