[wpimath] Fix pose estimator reset methods (#7225)

This commit is contained in:
Joseph Eng
2024-10-18 16:06:32 -07:00
committed by GitHub
parent ee22482f4a
commit 2054d0f57e
8 changed files with 474 additions and 0 deletions

View File

@@ -124,6 +124,8 @@ class WPILIB_DLLEXPORT PoseEstimator {
void ResetPose(const Pose2d& pose) {
m_odometry.ResetPose(pose);
m_odometryPoseBuffer.Clear();
m_visionUpdates.clear();
m_poseEstimate = m_odometry.GetPose();
}
/**
@@ -134,6 +136,8 @@ class WPILIB_DLLEXPORT PoseEstimator {
void ResetTranslation(const Translation2d& translation) {
m_odometry.ResetTranslation(translation);
m_odometryPoseBuffer.Clear();
m_visionUpdates.clear();
m_poseEstimate = m_odometry.GetPose();
}
/**
@@ -144,6 +148,8 @@ class WPILIB_DLLEXPORT PoseEstimator {
void ResetRotation(const Rotation2d& rotation) {
m_odometry.ResetRotation(rotation);
m_odometryPoseBuffer.Clear();
m_visionUpdates.clear();
m_poseEstimate = m_odometry.GetPose();
}
/**