CALL locate.assembly args[], error)
args[ ] Real array containing the arguments for this statement. The individual elements are described below:
frame1
[1] Frame database record number that specifies the default reference frame to be used when positioning the camera to view the fiducial marks.DEFAULT frame2
[2] Optional Frame database record number, specifying the default reference frame to be used when positioning the camera to view the fiducial marks.APPROACH path
[3] Optional Path database record number that specifies the path to use when approaching the assembly. The value of this element must be 0 if no path is specified.LOCATE vision
[4] Vision database record number, specifying the vision operation to evaluate in order to locate a fiducial mark. This vision operation must return "frame" type data.AT loc1 - loc4
[5] - [8] Optional Assembly database record numbers, specifying the nominal location of additional fiducial marks. The actual fiducial marks must be visible when the camera is aimed at these locations. These records are found in the current Assembly database that is associated with the current sequence.DEPART path
[9] Optional Path database record number that specifies the path to follow when departing from the assembly location. The value of this element must be 0 if no path is specified.USING tool
[10] Optional Tool database record number that specifies the tool to use when performing this transfer operation. The value of this element must be 0 if the NULL tool is to be used.OK_SIGNAL variable
[11] An optional code for a Variable database output variable that receives -1 if the reference frame was successfully computed. Otherwise, it is set to zero. This argument should be set to the value of the global variable va.undef.var if the clause is omitted.error Real variable that receives a value indicating whether or not the operation was successful, and what action should be taken by the calling routine. See the standard AIM operator error response code values.
This statement uses vision to determine the precise value of the reference frame associated with an entire assembly. The statement is useful when assembly locations are specified relative to a general assembly reference frame. Then the problem is to precisely determine the assembly reference frame before performing a series of part placement operations.
This statement visually locates from one to four fiducial marks on the assembly and uses them to correct the value for the reference frame. If multiple fiducial marks are used, the position of the new reference frame is computed so that the centroid of all the database-specified fiducial marks is positioned at the centroid of all the visually determined fiducial marks.
The orientation of the new reference frame is computed by:
1. The angle of each fiducial mark with respect to the centroid.
2. The difference in angle between the database-specified fiducial marks and the visually determined fiducial marks.
3. An angular correction that is equal to the weighted average of all the angular differences. The weight used for each difference is equal to the distance from the centroid to the respective fiducial mark.
4. The angular correction is applied to the current frame value.
To assist with having this statement driven by CAD data, the locations of the fiducial marks should be specified relative to a reference frame used by the Assembly database locations. To position a camera for viewing each fiducial mark, an approximate reference frame is required. This frame can be specified via input parameter args[2]. If this argument is specified, the current reference frame is set equal to the value of the specified frame. Otherwise, the current reference frame is used.
The general operation of this statement is:
1. Open the optional default Frame database record and copy the frame value to the frame/reference frame.
2. Set the robot tool to the value specified or to NULL.
3. Move along the optional path to the location of the first fiducial mark.
4. Move so that the fiducial mark is seen by the camera.
5. Locate the fiducial mark using the vision runtime routine rn.vis.pic.list( ). If the vision operation is successful, save the data for later computation.
6. Loop to step 4 for all the defined fiducial marks.
7. Compute the new reference frame value using the general vision routine vi.fit.frame( ), and store the value in the Frame database.
8. If no error has occurred, move along the optional depart path.
The following general items should be observed when defining data for this statement:
1. All location data must be taught with the proper tool transformation in place.
2. The fiducial marks must be defined relative to the specified frame/reference frame.
3. The camera calibration(s) for the vision locations must have been performed with the proper tool transformation in place.
When defining data for the vision operation (LOCATE vision), the following items should be observed:
1. The vision operation should return a frame result that determines the position of the fiducial mark. This position must coincide with the position of the fiducial mark specified in the Assembly database. The orientation of the fiducial mark is significant if and only if exactly one fiducial mark is used.
2. The vision operation should reference a robot-mounted camera.
3. The picture record should have Vision target location selected for the location, and a path name specified in the PATH name data box.
4. The specified path record controls the motion parameters for moving to the picture-taking location. These parameters include speed, motion type, etc. The motion parameters associated with the fiducial location, including the approach and depart parameters, are not used.
5. This path record also controls the offset of the vision target with respect to the nominal fiducial-mark location. The path reference frame must be set to Dynamic. The path location is an offset, in robot coordinates, for the vision target. The value NULL causes the center of the fiducial mark to be used as the vision target. Nonzero values for X and Y move the vision target within the vision plane. If the camera is not mounted on the final link of the robot, the values of Z and orientation control the tool height and orientation with respect to the fiducial location when the picture is taken.
NOTE: To position the tool above the assembly, a negative Z offset is required.
6. When debugging the locate operation, you should observe the value of the reference frame for the database before and after the vision operation. If the value changes drastically, the camera calibration is incorrect, the parameters are set up incorrectly in the picture or camera records, or the parameters are set up incorrectly for the associated path.
For more details, see the descriptions of the routines rn.vis.pic.list( ) and vi.fit.frame( ) in the instruction manual for your robot.
locate_frame (in AIM MotionWare Reference Guide)
rn.vis.pic.list (refer to the instruction manual for your robot)
transfer.fp args[], error)
vi.fit.frame (refer to the instruction manual for your robot)TRANSFER {APPROACH path} PART part {ALONG path} TO assembly {DEPART path} {USING tool} {REJECT path}