From 3fe8d355a17b3a711543962b523ddf19748d5732 Mon Sep 17 00:00:00 2001 From: Starlight220 <53231611+Starlight220@users.noreply.github.com> Date: Tue, 22 Nov 2022 20:29:40 +0200 Subject: [PATCH] [examples] StateSpaceDifferentialDriveSimulation: Use encoder reversed constants (#4682) This matches the Java example. --- .../include/subsystems/DriveSubsystem.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceDifferentialDriveSimulation/include/subsystems/DriveSubsystem.h b/wpilibcExamples/src/main/cpp/examples/StateSpaceDifferentialDriveSimulation/include/subsystems/DriveSubsystem.h index 6f7d808392..57392c723b 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceDifferentialDriveSimulation/include/subsystems/DriveSubsystem.h +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceDifferentialDriveSimulation/include/subsystems/DriveSubsystem.h @@ -144,11 +144,13 @@ class DriveSubsystem : public frc2::SubsystemBase { // The left-side drive encoder frc::Encoder m_leftEncoder{DriveConstants::kLeftEncoderPorts[0], - DriveConstants::kLeftEncoderPorts[1]}; + DriveConstants::kLeftEncoderPorts[1], + DriveConstants::kLeftEncoderReversed}; // The right-side drive encoder frc::Encoder m_rightEncoder{DriveConstants::kRightEncoderPorts[0], - DriveConstants::kRightEncoderPorts[1]}; + DriveConstants::kRightEncoderPorts[1], + DriveConstants::kRightEncoderReversed}; // The gyro sensor frc::ADXRS450_Gyro m_gyro;