Package frc.lib5k.control
Class CubicDeadband
- java.lang.Object
-
- frc.lib5k.control.CubicDeadband
-
public class CubicDeadband extends java.lang.Object
This Scaling method was inspired by this blog post: http://www.mimirgames.com/articles/games/joystick-input-and-using-deadbands/ Formula: y = ((w * (x ^ 3) + (1.0 - w) * x) - (abs(x) / x) * (w * (d ^ 3) + (1.0 - w) * d)) / (1.0 - (w * (d ^ 3) + (1.0 - w) * d)) This can be visualized on desmos: https://www.desmos.com/calculator/awcputalxe
-
-
Constructor Summary
Constructors Constructor Description CubicDeadband(double deadband, double percision)
Cubic scaling deadband
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
feed(double input)
Pass an input through a cubic scaling function
-
-
-
Constructor Detail
-
CubicDeadband
public CubicDeadband(double deadband, double percision)
Cubic scaling deadband- Parameters:
deadband
- Deadband sizepercision
- This number should be set to user preference. The higher it is, the more precice small movements will be and the less precice big movements will be
-
-