Robot offset point (#98)

* Add offset point calculation in backend

* Add pipeline result caching

* Add dual offset unit test
This commit is contained in:
Banks T
2020-08-27 14:41:03 -04:00
committed by GitHub
parent 9f0e89ea29
commit b6d9fe216a
22 changed files with 415 additions and 218 deletions

View File

@@ -47,4 +47,13 @@ public class MathUtils {
public static double nanosToMillis(long nanos) {
return nanos / 1000000.0;
}
public static double map(
double value, double in_min, double in_max, double out_min, double out_max) {
return (value - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
public static int map(int value, int inMin, int inMax, int outMin, int outMax) {
return (int) Math.floor(map((double) value, inMin, inMax, outMin, outMax) + 0.5);
}
}