You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement scaling on the Driver Joysticks for cheesydrive. Reference scaling function from 79 below, steal if you want. These values will have to be tweaked based on driver prefs.
public static double mapJoystickToPowerOutput(double input)
{
if(Math.abs(input) < 0.05)
{
// Stop if joystick is near zero
return 0.0;
}
else
{
double mapping;
if(Math.abs(input) <= 0.75)
{
mapping = 0.95 * ((0.5 * MathUtils.pow(Math.abs(input), 2.0)) + 0.2);
mapping = (input >= 0) ? mapping : -mapping; // Change to negative if the input was negative
return mapping;
}
else
{
mapping = 2.16 * Math.abs(input) - 1.16;
mapping = (input >= 0) ? mapping : -mapping; // Change to negative if the input was negative
return mapping;
}
}
}
The text was updated successfully, but these errors were encountered:
Implement scaling on the Driver Joysticks for cheesydrive. Reference scaling function from 79 below, steal if you want. These values will have to be tweaked based on driver prefs.
The text was updated successfully, but these errors were encountered: