JMotor
Loading...
Searching...
No Matches
Functions
JDeadzoneRemover Namespace Reference

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.
 

Function Documentation

◆ calculate() [1/2]

float JDeadzoneRemover::calculate ( float  value,
float  start,
float  max,
float  deadzone = 0 
)
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);

Note
call with JDeadzoneRemover::calculate()
Parameters
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)
Return values
(float)output value

◆ calculate() [2/2]

JTwoDTransform JDeadzoneRemover::calculate ( JTwoDTransform  value,
JTwoDTransform  start,
JTwoDTransform  max,
JTwoDTransform  deadzone = { 0, 0, 0 } 
)
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);

Note
call with JDeadzoneRemover::calculate()
Parameters
valueinput value (constrained internally between -1 and 1)
startwhen value goes outside deadzone, output this
maxwhen value=1, output this
deadzone(default=0) deadzone for the input value (if your joystick might not center perfectly)
Return values
outputvalue