[wpilib] Add a default deadband to all gamepads (#8897)

The FTC DS had a deadband. Additionally, the FRC one had an implicit
deadband due to the only 8 bit resolution. We need a deadband by default
now with the high resolution gamepads.
This commit is contained in:
Thad House
2026-05-29 16:31:48 -07:00
committed by GitHub
parent 40fdb779d8
commit 635e971a02
5 changed files with 233 additions and 16 deletions

View File

@@ -127,14 +127,14 @@ Trigger CommandGamepad::Misc6(wpi::EventLoop* loop) const {
Trigger CommandGamepad::LeftTrigger(double threshold,
wpi::EventLoop* loop) const {
return Trigger(loop, [this, threshold] {
return m_hid.GetLeftTriggerAxis() > threshold;
return m_hid.GetAxis(wpi::Gamepad::Axis::LEFT_TRIGGER) > threshold;
});
}
Trigger CommandGamepad::RightTrigger(double threshold,
wpi::EventLoop* loop) const {
return Trigger(loop, [this, threshold] {
return m_hid.GetRightTriggerAxis() > threshold;
return m_hid.GetAxis(wpi::Gamepad::Axis::RIGHT_TRIGGER) > threshold;
});
}