mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
[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:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user