[commands] Add deadband trigger methods to CommandGenericHID (#7085)

Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
This commit is contained in:
Nicholas Armstrong
2024-10-11 01:03:01 -04:00
committed by GitHub
parent f150b36108
commit 968bdf0d06
3 changed files with 55 additions and 0 deletions

View File

@@ -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);