Quote:
Originally Posted by cjlane1138
You know how the tracking gives us a number per square detected right? So its 0-3 for the squares? How do I tell the robot that I want to move to x square that was recognized? Basically, how does the processing software assign its values?
|
What number are you referring to? The tracking function will give you a sorted array of potential targets. If you have "good filtering", the size of the array would be between 1 to 4 targets, depending on how many of them are in view. If you have more than 4 targets, it means you have some false positives. I am not 100% sure, but I have an impression that the array is sorted by quality, so up to the first four are likely valid targets, the rest can be discarded. Regardless, when enumerating the targets in the array, you should validate them yourself. One good validation is to check the aspect ratio of the rectangle. Taking perspective into account, we choose targets with an aspect ratio between 1.0 to 2.0.
When enumerating the targets in the array, not only that you validate and discard false positive targets, you also go through an algorithm to "select target". In teleop mode, the target selection is driven by the drivers. After we got the array of possible targets filtered down, we (would like to) display the rectangle overlays on the video stream of the driver station. A pair of buttons on the joystick are used by the driver to "cycle" through the possible targets. Then we use the data of the selected target to compute the shooter motor speed according to the target distance and height.