RobotCasserole1736 / RobotCasserole2017

Robot Casserole robot source code for the 2017 FRC game, First Steamworks.
MIT License
0 stars 0 forks source link

Say no target found if range comes back as NAN #91

Closed gerth2 closed 7 years ago

gerth2 commented 7 years ago

The math used to calcualte range to the target presumes the camera-to-upper-tape distance is bigger than the height of the target. If this is not true, you'll get NaN for the calcualtion of the distance (sqrt of a negative number).

When this happens, we can probably presume whatever we're looking at isn't actually the target we're looking for.

these aren't

Update the logic in the vision target qualification system to detect this, and override to say there is no target visible when this happens.

gerth2 commented 7 years ago

Updated