Team841 / FRC-2019

2 stars 1 forks source link

Move deadband handling into OI code #2

Open samneff72 opened 4 years ago

samneff72 commented 4 years ago

Deadband: A set of operator inputs that are ignored as 'junk'

All joystick controllers have a small area "near zero" that is not actually zero, but we should treat as zero. When the joystick inputs are "almost" zero, the operator interface (OI) code should tell the robot they are actually zero.

Right now, that is handled in the CheesyDrive class in DriveTrain object, after passing raw stick values in from the OI. That's dumb, because the joystick will always need to have a deadband filter applied, no matter what part of the code is pulling the value, so the OI for the gamepad should handle this immediately instead of rewriting deadband code every time we use a joystick input.