From bd7a88a6d03c9d22cc1dca47952388b363b9f337 Mon Sep 17 00:00:00 2001 From: Warren Reynolds <43365474+w-reynolds@users.noreply.github.com> Date: Wed, 19 Nov 2025 12:13:27 +1100 Subject: [PATCH] [examples] Fix order of Swerve Modules in Odometry Update (#8396) The order of the Swerve Modules in the m_odometry.Update call needs to match the order they are defined in the creation of the kDriveKinematics object. --- .../SwerveControllerCommand/cpp/subsystems/DriveSubsystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/subsystems/DriveSubsystem.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/subsystems/DriveSubsystem.cpp index a6b810a386..cace6112d1 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/subsystems/DriveSubsystem.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/subsystems/DriveSubsystem.cpp @@ -45,8 +45,8 @@ DriveSubsystem::DriveSubsystem() void DriveSubsystem::Periodic() { // Implementation of subsystem periodic method goes here. m_odometry.Update(m_gyro.GetRotation2d(), - {m_frontLeft.GetPosition(), m_rearLeft.GetPosition(), - m_frontRight.GetPosition(), m_rearRight.GetPosition()}); + {m_frontLeft.GetPosition(), m_frontRight.GetPosition(), + m_rearLeft.GetPosition(), m_rearRight.GetPosition()}); } void DriveSubsystem::Drive(units::meters_per_second_t xSpeed,