mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Add SimValue reset() function (#3064)
This enables correct behavior for resetting incremental sensor values like encoder counts or gyro accumulated angle with WebSockets.
This commit is contained in:
@@ -114,10 +114,7 @@ double ADXRS450_Gyro::GetRate() const {
|
||||
|
||||
void ADXRS450_Gyro::Reset() {
|
||||
if (m_simAngle) {
|
||||
m_simAngle.Set(0.0);
|
||||
}
|
||||
if (m_simRate) {
|
||||
m_simRate.Set(0.0);
|
||||
m_simAngle.Reset();
|
||||
}
|
||||
m_spi.ResetAccumulator();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user