With the high contrast created by the retro-reflective tape, we can use a different method than rgb color processing for these images. The process involves identifying the patterns on a tote and using the patterns to determine position information of the pattern relative to the robot. First, we need an example image on which to test.
We then need an idealized pattern that represents what we are looking for:
The White area is where we would expect to see the reflective tape, the black area is where we do NOT expect to see any edges or bright areas, and finally the gray locations are ignored and not relevant to the identification.
We can then use this pattern in the Target Localization module to identify the pattern in the image.
Once the target is detected, several variables are set that indicate the location and distance to the target. These include:
TL_Y_ROTATION - the Y axis rotation of the target relative to the robot. This value reflects what orientation the targeting system needs to rotate to in order to focus on the center of the target (middle goal).
TL_TARGET_DISTANCE - the distance from the robot to the target. This can be used to calibrate the power of the shooting system.
These variables can be transmitted to the CRio for translation into motor or servo values using the Network Tables module.