I believe the code @AllenGregoryIV is referenceing relates specifically to calculating the robot’s pose based on vision data (including distance to the target). We used a circle fitting algorithm that feeds into our odometry system. I’ve included some links below where I talk about how it works in our build thread.
This is useful specifically if you care about full field localization, since the pose will be accurate even if the target is at an angle. If you just need the distance to the target when you’re already aimed at it, using the angle or size of the target is much simpler.