Robot Program¶
The wenglor device node¶
With the wenglor device you have access to all method calls of the robot vision API (see chapter 4.6 Generic Robot Vision API).

All methods of the wenglor node provide a test option that executes the method without the need of a robot program. To execute the method, in this case a job change, enter the desired job name and hit the play button.

Update the example program¶
The robot example program uses the methods and is prepared that only small adjustments are necessary. Update the calibration target in the following two commands:
- Calculate Calibration
- Calibrate Ground
At the command Calculate Calibration, update the calibration target in the run_calibration subprogram.

At the command Calculate Ground, update the calibration target in the run_calibration subprogram at the second calibration step if the camera is not mounted on the robot.

Update the uniVision job names. The example contains the following default uniVision job names:
- Calibration job: calibration.u3p
- Detection of objects: find_objects.u3p
Use the same job names in uniVision or update the job names in the robot program at the following places:
- At the beginning of the subprogram
run_calibration. - At the end of the subprogram
prepare_detection.

Update the detection job at the end of the subprogram prepare_detection.

Set Payload and TCP¶
Set payload and update TCP via:
- Updating the system variables
- Creating variables that are assigned to the system variables within the program
In case of multiple tools, create a variable for each tool and assign it, when the tool is changed. At the beginning of the program, add those two commands.

Run the program¶
| Subprogram name | Details |
|---|---|
| prepare_detection | Checks the camera state for errors and the calibration state. In case of no available calibration, it calls the run_calibration subprogram. After the calibration program, it checks the state again to see if the calibration was successful. If not, the program quits. Otherwise, the detection job is loaded. |
| single_detection | Calls prepare_detection first. Triggers a detection and moves the robot in a linear movement to the object. Even in case of multiple found objects, the subprogram only moves to one object. |
| multi_detection | Calls prepare_detection first. Triggers a detection and moves the robot to all objects. The movement will take place from one object to the next one, until no further object is available. At first, it checks the number of found objects. Then it iterates through the object information via an index accessor. |
| run_calibration | Loads the calibration job, clears the temporary calibration data (not the calibration itself) and moves the robot to the calibration poses. Then it calculates the calibration. If the camera is not mounted on the robot, it performs the second calibration step to calibrate the camera to object ground level. At the end, it calls validate_calibration. |
| validate_calibration | Checks the calibration results by moving the robot TCP to the bottom left corner of the calibration target. As the camera is not triggered again, it is important that the calibration target was not moved between the calibration and the validation. For safety reasons, enter a safety offset before the actual movement. This safety offset shifts the target pose above the calibration target. |
Select the subprogram to execute.
