mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
[wpimath] Fix pose estimator reset methods (#7225)
This commit is contained in:
@@ -134,6 +134,8 @@ public class PoseEstimator<T> {
|
||||
public void resetPose(Pose2d pose) {
|
||||
m_odometry.resetPose(pose);
|
||||
m_odometryPoseBuffer.clear();
|
||||
m_visionUpdates.clear();
|
||||
m_poseEstimate = m_odometry.getPoseMeters();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,6 +146,8 @@ public class PoseEstimator<T> {
|
||||
public void resetTranslation(Translation2d translation) {
|
||||
m_odometry.resetTranslation(translation);
|
||||
m_odometryPoseBuffer.clear();
|
||||
m_visionUpdates.clear();
|
||||
m_poseEstimate = m_odometry.getPoseMeters();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,6 +158,8 @@ public class PoseEstimator<T> {
|
||||
public void resetRotation(Rotation2d rotation) {
|
||||
m_odometry.resetRotation(rotation);
|
||||
m_odometryPoseBuffer.clear();
|
||||
m_visionUpdates.clear();
|
||||
m_poseEstimate = m_odometry.getPoseMeters();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user