[wpilib] Fix DiffDriveSim pose reset and example (#2837)

Calling the resetPosition method on an odometry instance expects encoder positions to be reset to zero.
This commit is contained in:
Prateek Machiraju
2020-11-12 01:37:14 -05:00
committed by GitHub
parent 5c2dc043cd
commit 616405f7ae
4 changed files with 8 additions and 0 deletions

View File

@@ -192,6 +192,8 @@ public class DifferentialDrivetrainSim {
m_x.set(State.kX.value, 0, pose.getX());
m_x.set(State.kY.value, 0, pose.getY());
m_x.set(State.kHeading.value, 0, pose.getRotation().getRadians());
m_x.set(State.kLeftPosition.value, 0, 0);
m_x.set(State.kRightPosition.value, 0, 0);
}
@SuppressWarnings({"DuplicatedCode", "LocalVariableName"})