[wpimath] Reset prev_time on pose estimator reset (#4283)

This commit is contained in:
Prateek Machiraju
2022-06-02 21:21:42 -07:00
committed by GitHub
parent 8b6df88783
commit d9f9cd1140
6 changed files with 12 additions and 0 deletions

View File

@@ -58,6 +58,8 @@ void DifferentialDrivePoseEstimator::ResetPosition(
m_observer.SetXhat(FillStateVector(pose, 0_m, 0_m));
m_prevTime = -1_s;
m_gyroOffset = GetEstimatedPosition().Rotation() - gyroAngle;
m_previousAngle = pose.Rotation();
}

View File

@@ -59,6 +59,8 @@ void frc::MecanumDrivePoseEstimator::ResetPosition(
m_observer.SetXhat(PoseTo3dVector(pose));
m_prevTime = -1_s;
m_gyroOffset = pose.Rotation() - gyroAngle;
m_previousAngle = pose.Rotation();
}