Skip to content

Commit

Permalink
Do not reset gyro on pose estimator reset
Browse files Browse the repository at this point in the history
  • Loading branch information
superpenguin612 committed Mar 21, 2024
1 parent 968e812 commit 433da39
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/frc/robot/subsystems/Drivetrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,11 @@ public void updatePoseEstimator() {

@Override
public void resetPoseEstimator(Pose2d pose) {
poseEstimator.resetPosition(getRotation(), getModulePositions(), pose);
poseEstimator.resetPosition(getRotation(), getModulePositions(),
new Pose2d(pose.getTranslation(), getRotation()));
if (RobotBase.isSimulation())
simOdometry.resetPosition(getRotation(), getModulePositions(), pose);
simOdometry.resetPosition(getRotation(), getModulePositions(),
new Pose2d(pose.getTranslation(), getRotation()));
}

@Override
Expand Down

0 comments on commit 433da39

Please sign in to comment.