Repository navigation
[SPIKE, do not merge] Migrate XbotEdu to WPILib 2027 alpha 7 - #50
Draft
aschokking wants to merge 6 commits into
Draft
aschokking wants to merge 6 commits into
aschokking wants to merge 6 commits into
Conversation
SeriouslyCommonLib #636 (2026-07-13) made devices register themselves with a DataFrameRegistry when they are created, and BaseRobot refreshes them all each loop. Subsystems no longer need to implement DataFrameRefreshable and forward refreshDataFrame() to their motors, and Robot no longer needs to add them to a list. XbotEdu was pinned to SCL 20260405.5, which predates #636 - no registry, and BaseRobot still had the manual dataFrameRefreshables list. So removing the plumbing requires the SCL bump; on the old version it was the only thing refreshing the drive motors. SCL version: 20261003.3 is the newest published build that both includes the registry and targets Java 17. From 20261003.6 the artifacts are compiled for Java 25 (class file version 69) for the WPILib 2027 line, which XbotEdu's 2026 toolchain cannot load. Changes: - DriveSubsystem, SwerveDriveSubsystem: drop DataFrameRefreshable and refreshDataFrame(). The CurrentSwerveState log that lived inside SwerveDriveSubsystem.refreshDataFrame() moves to periodic(). - Robot: drop the dataFrameRefreshables.add(...) calls. Both subsystems are still created, since EduSimulator and SubsystemDefaultCommandMap inject them. - Tests: subsystem.refreshDataFrame() becomes getInjectorComponent().dataFrameRegistry().refreshAll(). - Tests: MockXboxControllerAdapter and MockTimer moved from edu.wpi.first.wpilibj to xbot.common.controls.sensors.mock_adapters in the newer SCL; imports updated. Verified: compiles, checkstyle passes, and the full test suite gives the identical per-test result as main (same 4 pass, same 16 student-exercise tests fail with the same messages). DriveToPositionCommandTest reports the same final distance (5.002332505667951) over 300 loops on both, which only matches if the registry refreshes motor positions the way the manual calls did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exploratory migration to measure the cost of moving XbotEdu to WPILib 2027, modelled on FRCRobotTemplate main (migrated in #88). Built on top of the data-frame cleanup branch (PR #49). Result: main and test code compile on 2027.0.0-alpha-7 / Java 25 / SCL 20261003.9, and all 16 tests that can run here give identical results to 2026 (DriveToPositionCommandTest final distance 5.002332505667951 on both). The 4 SwerveDriveWithJoysticksCommandTest cases are excluded: Smart App Control on this machine blocks the unsigned alpha wpimathjni.dll. Build: Gradle 9.4.1, org.wpilib.GradleRIO 2027.0.0-alpha-7, Java 25 toolchain, SystemCore deploy target (2027 has no roboRIO target), AspectJ weaving removed, frcYear 2027_alpha7, vendordeps from the template. API changes hit: - edu.wpi.first.* -> org.wpilib.* package moves - ChassisSpeeds -> ChassisVelocities (.omega), SwerveModuleState -> SwerveModuleVelocity, toSwerveModuleStates/toChassisSpeeds -> *Velocities - PropertyFactory/DoubleProperty -> TunableFactory/TunableDouble (createPersistentProperty -> createDouble) - SmartDashboard.putData -> Tunables.publish - LinearSystemId.createFlywheelSystem -> Models.flywheelFromPhysicalConstants - FlywheelSim.getAngularVelocityRadPerSec -> getAngularVelocity (still rad/s) - DriverStation.isEnabled -> RobotState.isEnabled - MathUtil.clamp removed -> Math.clamp - getifAvailable(XboxButton.Start) -> getXboxButtonIfAvailable(Button.MENU) - Command.schedule() removed -> CommandScheduler.getInstance().schedule(cmd) - requires(subsystem) -> addRequirements(subsystem) - UnsupportedHardwareModule stub for XLaserCANFactory, copied from the template (2027 SCL's RealDevicesModule no longer binds it) The test filter at the end of build.gradle is spike-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve conflicts in build.gradle and SwerveDriveSubsystem.java by keeping the 2027 migration side (SCL 20261003.9, org.wpilib.* imports). Main's only new commit (#49) is the squash of this branch's base commit, so no content from main is lost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI agents (JavaToolInstaller pinned to JDK 17) have no Java 25 install, so :compileJava failed resolving the toolchain. The foojay resolver lets Gradle download a matching JDK when none is found locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Warning
Spike, do not merge. This is an exploratory migration to measure what moving XbotEdu to WPILib 2027 would take. It targets an alpha toolchain and includes a spike-only test filter. Kept as a draft for reference when 2027 is released.
Built on top of #49 (data frame cleanup), and modelled on FRCRobotTemplate
main, which was migrated to 2027 in Team488/FRCRobotTemplate#88.Result
2027.0.0-alpha-7with Java 25 and SCL20261003.9.DriveToPositionCommandTestlands at5.002332505667951on both 2026 and 2027, identical to every digit across 300 loops.SwerveDriveWithJoysticksCommandTestcases are excluded: Windows Smart App Control on the dev machine blocks the unsigned alphawpimathjni.dll, whichFlywheelSimneeds. See "Blockers" below.Build changes
edu.wpi.first.GradleRIO2026.2.1org.wpilib.GradleRIO2027.0.0-alpha-7RoboRIOSystemCorefrcYear2027_alpha7Vendordeps are replaced with the template's 2027 set (AdvantageKit 27 alpha, REVLib 2027 alpha, Phoenix 6 26.50 alpha, photonlib dev build, PathPlanner, Commands V2). LaserCAN and Studica are dropped.
API changes hit
Each replacement was checked against the 2027 jars or WPILib sources, not guessed:
edu.wpi.first.*org.wpilib.*(package moves)ChassisSpeeds/.omegaRadiansPerSecondChassisVelocities/.omegaSwerveModuleStateSwerveModuleVelocitytoSwerveModuleStates/toChassisSpeedstoSwerveModuleVelocities/toChassisVelocitiesPropertyFactory/DoubleProperty/createPersistentPropertyTunableFactory/TunableDouble/createDoubleSmartDashboard.putData(name, cmd)Tunables.publish(name, cmd)(same run/stop toggle)LinearSystemId.createFlywheelSystemModels.flywheelFromPhysicalConstants(same arg order)FlywheelSim.getAngularVelocityRadPerSec()getAngularVelocity()(still rad/s)DriverStation.isEnabled()RobotState.isEnabled()MathUtil.clampMath.clampgetifAvailable(XboxButton.Start)getXboxButtonIfAvailable(Button.MENU)cmd.schedule()CommandScheduler.getInstance().schedule(cmd)requires(subsystem)addRequirements(subsystem)Also adds
UnsupportedHardwareModule(copied from the template), because 2027 SCL'sRealDevicesModuleno longer bindsXLaserCANFactory.Blockers before this could ship
wpimathjni. 2026 release DLLs pass the same check.Curriculum docs that would need updating
Start→MENU.CommandScheduler.getInstance().schedule(cmd).DriveSubsystemsnippet showsPropertyFactory pf.SwerveModuleState/speedMetersPerSecondbecomeSwerveModuleVelocity/velocity.temurin-17becomes Java 25.Not tested
The interactive simulator, AdvantageScope or Elastic on 2027, deploying to hardware, and the 4 excluded swerve tests.
🤖 Generated with Claude Code