mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[examples] Don't reset encoders when resetting odometry (#6329)
This commit is contained in:
@@ -102,7 +102,6 @@ public class DriveSubsystem extends SubsystemBase {
|
||||
* @param pose The pose to which to set the odometry.
|
||||
*/
|
||||
public void resetOdometry(Pose2d pose) {
|
||||
resetEncoders();
|
||||
m_odometry.resetPosition(
|
||||
m_gyro.getRotation2d(), m_leftEncoder.getDistance(), m_rightEncoder.getDistance(), pose);
|
||||
}
|
||||
|
||||
@@ -123,8 +123,6 @@ public class Drivetrain {
|
||||
|
||||
/** Resets robot odometry. */
|
||||
public void resetOdometry(Pose2d pose) {
|
||||
m_leftEncoder.reset();
|
||||
m_rightEncoder.reset();
|
||||
m_drivetrainSimulator.setPose(pose);
|
||||
m_odometry.resetPosition(
|
||||
m_gyro.getRotation2d(), m_leftEncoder.getDistance(), m_rightEncoder.getDistance(), pose);
|
||||
|
||||
@@ -179,7 +179,6 @@ public class DriveSubsystem extends SubsystemBase {
|
||||
* @param pose The pose to which to set the odometry.
|
||||
*/
|
||||
public void resetOdometry(Pose2d pose) {
|
||||
resetEncoders();
|
||||
m_drivetrainSimulator.setPose(pose);
|
||||
m_odometry.resetPosition(
|
||||
Rotation2d.fromDegrees(getHeading()),
|
||||
|
||||
Reference in New Issue
Block a user