JMotor
|
Functions | |
float | calculate (float value, float start, float max, float deadzone=0) |
If a motor's minimum speed is high, you can use this function to reduce the deadzone where nothing moves. | |
JTwoDTransform | calculate (JTwoDTransform value, JTwoDTransform start, JTwoDTransform max, JTwoDTransform deadzone={ 0, 0, 0 }) |
If a motor's minimum speed is high, you can use this function to reduce the deadzone where nothing moves. | |
|
inline |
If a motor's minimum speed is high, you can use this function to reduce the deadzone where nothing moves.
example usage: value = JDeadzoneRemover::calculate(value, myController.getMinVel(), myController.getMaxVel(), .01);
value | (float) input value |
start | (float) when value goes outside deadzone, output this |
max | (float) when value=1, output this |
deadzone | (float, default=0) deadzone for the input value (if your joystick might not center perfectly) |
(float) | output value |
|
inline |
If a motor's minimum speed is high, you can use this function to reduce the deadzone where nothing moves.
example usage: value = JDeadzoneRemover::calculate(value, myController.getMinVel(), myController.getMaxVel(), .01);
value | input value (constrained internally between -1 and 1) |
start | when value goes outside deadzone, output this |
max | when value=1, output this |
deadzone | (default=0) deadzone for the input value (if your joystick might not center perfectly) |
output | value |