|
Re: Desensitizing Joysticks
Beware of low pass filters. We used an LPF on the joystick once and we decided that we didn't like using it. Under acceleration, it's fine, but under stopping, it's not so good. To make the story short, it will cause you to overshoot (because it ramps down your input just like it ramps it up). You can try some funky "if increasing do this, if decreasing do that" logic, but I really don't think it's worth it.
Also, the deadbands that have been described here are discontinuous deadbands, which are generally considered "hack" deadbands in the controls world (due to their abrupt change at the deadzone point). For a continuous deadzone (more commonly used), do this:
DeadZone = 15; // Calibration parameter
if (Joy > (127-DeadZone) && Joy < (127+DeadZone)) Joy = 127;
else if (Joy <= (127-DeadZone)) Joy += DeadZone;
else Joy -= DeadZone;
__________________
-
An ounce of perception is worth a pound of obscure.
Last edited by Chris Hibner : 03-02-2004 at 17:04.
|