dogecv / DogeCV

FTC Vision Library
https://discord.gg/colton
GNU General Public License v3.0
68 stars 64 forks source link

Additions to the GoldAlignDetector #29

Closed ThunderPengwins closed 5 years ago

ThunderPengwins commented 5 years ago

During the tournament, we found the camera would often find gold elements in the crater, or other yellow objects outside of the field. To remedy this, we created a Y range that constrains the position of the element. The original function, getAligned(), is still operational, but another function has been added: getConstrained(), which utilizes the Y position. We've done our best to keep the changes consistent with the previous code, including the placement of variables, if statements, and javadocs. Two lines have been added to the RobotController view, which mark the Y range. The Y position and getConstrained() output are also displayed. Two other functions (limitPositive() and getY()) were also made to assist getConstrained(), but do not affect any other code. As with the align size and offset, the constrain size and offset can be changed in programs that use this class. The only difference is that the constrain offset stems from the top instead of the center. These values are set to 0 as default. These changes allow the GoldAlignDetector to be competition ready (which we can attest to). We hope you'll consider accepting our pull request.