Repository navigation
Conversation
Split commands from SwerveDrive, extract dynamics and module optimization, and add pure and simulation unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Expand frc-unit-tests.mdc with AAA conventions; mention in AGENTS.md. Add section comments across HID, drive, and constants tests. Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Break RobotContainer static init cycle with Supplier<Rotation2d>. Skip PathPlanner in tests; add SwerveDriveTest and sim test helpers. Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Add SwerveDriveTestFixture (shared sim instance), 13 subsystem tests, 6 command integration tests, HAL init guard, and test ordering fixes. Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Module positions, vision heading std devs, goSlow scaling contract, DriverStation sim alliance sign; strengthen goSlow unit test. Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Remove per-class fixture teardown that broke other classes, drop duplicate CommandScheduler registration, reset shared sim state between methods, recreate Xbox sim controllers after DriverStation reset, and enable random test order in CI. Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Kinematic module angles from toSwerveModuleStates were fed into the pose estimator each tick, which can jump during path rotation and unlike main (which uses measured pivot encoders) caused erratic Field2d heading in auto. Desktop simulateJava now integrates robot-relative chassis speeds with transformBy instead. Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
PathPlanner needs non-zero getChassisSpeeds() and pose that tracks the path. Kinematic sim reported zero module speeds and open-loop pose integration desynced from trajectory rotation targets. Auto now uses module physics odometry like main; teleop keeps chassis-speed integration. Sim gyro uses simulationHeading instead of NavX; skip vision fusion in simulateJava. Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
Restore drive and RobotContainer to e3b3d1d before the two recent simulateJava pose-integration commits that were pushed prematurely. Co-authored-by: ernestgwilsoniii <ernestgwilsoniii@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors swerve drivetrain code for clarity and testability:
DriveCommands, extracted kinematics/dynamics/optimization,FieldConstants, and HID teleop helpers. Includes merge of latestmain. No intentional change to wired teleop, PathPlanner autos, or Limelight odometry — D15 regression still required before merge.Head:
cursor/swerve-drive-refactor-mr-256b(cloud-agent branch; same work stream asrefactor/swerve-drive-and-tests)What changed
SwerveDrive/SwerveModule: hardware and control loops;Supplier<Rotation2d>for gyro heading (production:() -> kNavx.getRotation2d()inRobotContainer)DriveCommands: teleop, go slow, defense hold-heading, practice reset, stop, lock (moved out of the subsystem)DemonCommandXboxController+HIDUtils: shared stick deadband/cubic scaling (replacesSwerveTeleopInputs)SwerveDriveTest,DriveCommandsintegration, motion/optimization/dynamics);SwerveDriveTestFixture+resetBetweenTests(); JUnit random method order (MethodOrderer$Random)frc-unit-tests.mdc;AGENTS.mdpoints at test and cloud setup.cursor/cloud-install.sh(roboRIO deploy unchanged)mavenCentral()insettings.gradlefor Gradle plugin resolutionDriver / auto impact
Behavior-preserving for what is wired today: default field-relative teleop, go-slow, defense heading hold, practice reset (1.016 m, 4.0 m), boot odometry seed, PathPlanner
AutoBuilder, named commandSTOPSwerve, Limelight pose fusion. Unused swerve-only helpers removed (not referenced fromRobotContaineror deploy autos).Test plan
./gradlew test/./gradlew build(GitHub CI)STOPSwerveif your routines use it./gradlew simulateJava,elastic/pathplannerafter environment build