[wpilib] DutyCycleEncoder: Fix reset behavior (#5287)

reset should set the offset to the properly scaled position provided by getAbsolutePosition, not the raw duty cycle.
This commit is contained in:
Ryan Blue
2023-05-13 00:28:32 -04:00
committed by GitHub
parent 91392823ff
commit 218cfea16b
2 changed files with 2 additions and 2 deletions

View File

@@ -164,7 +164,7 @@ void DutyCycleEncoder::Reset() {
if (m_counter) {
m_counter->Reset();
}
m_positionOffset = m_dutyCycle->GetOutput();
m_positionOffset = GetAbsolutePosition();
}
bool DutyCycleEncoder::IsConnected() const {