This directory contains scripts for determining the exact position of the robot from the identified distances to key visual fiducials placed in certain areas on the field. The robot triangulates its position by obtaining distance measurements to three of eight visual fiducials, known as AprilTags. By optimizing the choice of these fiducials and then performing the triangulation, the robot can determine a very good estimate of its exact position. This method also allows for more than three AprilTags to be used, which can enhance the accuracy of these estimations.
Running the main script will run tests to determine if all locators are working correctly. If all tests run successfully, you should get a message like this:
Running tests...
================
Testing circle intersection logic...
Testing triangulation procedures...
Testing tag-based location...
All tests passed!The circle intersection logic is used to calculate the point of intersection between two circles or, if it does not exist, the point closest to both circles. The triangulation procedures rely on the circle intersection logic to determine the point closest to three or more distinct fiducials. Lastly, the tag-based location algorithm maps this point to a destination on the field with coordinates relative to the field center.