mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] Reset prev_time on pose estimator reset (#4283)
This commit is contained in:
committed by
GitHub
parent
8b6df88783
commit
d9f9cd1140
@@ -226,6 +226,8 @@ public class DifferentialDrivePoseEstimator {
|
||||
|
||||
m_observer.setXhat(fillStateVector(poseMeters, 0.0, 0.0));
|
||||
|
||||
m_prevTimeSeconds = -1;
|
||||
|
||||
m_gyroOffset = getEstimatedPosition().getRotation().minus(gyroAngle);
|
||||
m_previousAngle = poseMeters.getRotation();
|
||||
}
|
||||
|
||||
@@ -190,6 +190,8 @@ public class MecanumDrivePoseEstimator {
|
||||
|
||||
m_observer.setXhat(StateSpaceUtil.poseTo3dVector(poseMeters));
|
||||
|
||||
m_prevTimeSeconds = -1;
|
||||
|
||||
m_gyroOffset = getEstimatedPosition().getRotation().minus(gyroAngle);
|
||||
m_previousAngle = poseMeters.getRotation();
|
||||
}
|
||||
|
||||
@@ -188,6 +188,8 @@ public class SwerveDrivePoseEstimator {
|
||||
|
||||
m_observer.setXhat(StateSpaceUtil.poseTo3dVector(poseMeters));
|
||||
|
||||
m_prevTimeSeconds = -1;
|
||||
|
||||
m_gyroOffset = getEstimatedPosition().getRotation().minus(gyroAngle);
|
||||
m_previousAngle = poseMeters.getRotation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user