mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-21 01:01:41 +00:00
Replace JPigpio, add hardware PWM support (#127)
* Send brightness properly to clients * Refactor GPIO, add custom Pigpio socket wrapper * Replace PiGPIO with PigpioPin, fix hardwarePWM * Remove Jpigpio dependency * Apply Spotless * Warn user of Pigpio pin incapable of hardware PWM * Begin rework of blinking and brightness control for vision leds * Fixed blink, fixed brightness persistence, added bootup blink * Cleanup HardwareManager access of config * Apply spotless * Skip hardware test on non-Pi Co-authored-by: Matt <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -22,19 +22,6 @@ import org.apache.commons.math3.util.FastMath;
|
||||
public class MathUtils {
|
||||
MathUtils() {}
|
||||
|
||||
public static double sigmoid(Number x) {
|
||||
double bias = 0;
|
||||
double a = 5;
|
||||
double b = -0.05;
|
||||
double k = 200;
|
||||
|
||||
if (x.doubleValue() < 50) {
|
||||
bias = -1.338;
|
||||
}
|
||||
|
||||
return ((k / (1 + Math.pow(Math.E, (a + (b * x.doubleValue()))))) + bias);
|
||||
}
|
||||
|
||||
public static double toSlope(Number angle) {
|
||||
return FastMath.atan(FastMath.toRadians(angle.doubleValue() - 90));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user