mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-21 01:01:41 +00:00
PiCam Tweaks (#63)
* Update QuirkyCamera to do name-based matching * Add pi-cam exposure set * Refactor QuirkyCamera * Add PiCam quirk test, fix tests for no-name quirky cameras * Apply Spotless * Add pinhole model unit test
This commit is contained in:
@@ -39,6 +39,14 @@ public class MathUtils {
|
||||
return FastMath.atan(FastMath.toRadians(angle.doubleValue() - 90));
|
||||
}
|
||||
|
||||
public static int safeDivide(int quotient, int divisor) {
|
||||
if (divisor == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return quotient / divisor;
|
||||
}
|
||||
}
|
||||
|
||||
public static double roundTo(double value, int to) {
|
||||
double toMult = Math.pow(10, to);
|
||||
return (double) Math.round(value * toMult) / toMult;
|
||||
|
||||
Reference in New Issue
Block a user