mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[commands] Add deadband trigger methods to CommandGenericHID (#7085)
Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f150b36108
commit
968bdf0d06
@@ -75,6 +75,13 @@ Trigger CommandGenericHID::AxisGreaterThan(int axis, double threshold,
|
||||
});
|
||||
}
|
||||
|
||||
Trigger CommandGenericHID::AxisMagnitudeGreaterThan(
|
||||
int axis, double threshold, frc::EventLoop* loop) const {
|
||||
return Trigger(loop, [this, axis, threshold]() {
|
||||
return std::abs(m_hid.GetRawAxis(axis)) > threshold;
|
||||
});
|
||||
}
|
||||
|
||||
void CommandGenericHID::SetRumble(frc::GenericHID::RumbleType type,
|
||||
double value) {
|
||||
m_hid.SetRumble(type, value);
|
||||
|
||||
Reference in New Issue
Block a user