Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0e4b80a
Target WPILib 2027.0.0-alpha-2 for sim-only sandbox (config + vendord…
nlaverdure Jun 11, 2026
c5bc40a
Work around akit-autolog @AutoLog codegen not running in Gradle
nlaverdure Jun 11, 2026
20d9bc6
Fix SwerveModule field renames for WPILib 2027
nlaverdure Jun 11, 2026
c272da7
Fix ChassisSpeeds API changes for WPILib 2027
nlaverdure Jun 11, 2026
8af6adc
Migrate HAL usage reporting from FRCNetComm to 2027 API
nlaverdure Jun 11, 2026
00771ae
Fix DCMotor.freeSpeedRadPerSec field rename for WPILib 2027
nlaverdure Jun 11, 2026
def7316
Fix AprilTagFields constant for WPILib 2027
nlaverdure Jun 11, 2026
e2042f4
Fix DriverStation.getStickPOV() type change for WPILib 2027
nlaverdure Jun 11, 2026
06bada1
Remove LiveWindow.disableAllTelemetry() — package removed in 2027
nlaverdure Jun 11, 2026
aefe547
Fix AddressableLED.start() removed in WPILib 2027
nlaverdure Jun 11, 2026
9cce491
Reorganize CAN buses for SystemCore; fix PD/Compressor constructors
nlaverdure Jun 11, 2026
374e28e
Fix DCMotorSim getter renames and Commands.waitSeconds removal
nlaverdure Jun 11, 2026
bee929c
formatting
nlaverdure Jun 11, 2026
b90e9be
Update build toolchain for JDK 25 compatibility
nlaverdure Jun 11, 2026
2be9bf3
Fix Command.schedule() deprecation in AutoSelector
nlaverdure Jun 11, 2026
e3ef55b
Fix CI for WPILib 2027 alpha toolchain (#14)
nlaverdure Jun 22, 2026
f00eb7d
Merge main-2027-alpha2 into main-2027-alpha6
nlaverdure Jul 3, 2026
a42995d
Fix vendordep wpilibYear field for GradleRIO 2027-alpha-6 build compa…
nlaverdure Jul 3, 2026
93c92db
Normalize vendordep JSON indentation from alpha-2 into alpha-6 merge
nlaverdure Jul 3, 2026
b62fb4c
Fix import paths for WPILib 2027-alpha-6 package reorganization
nlaverdure Jul 3, 2026
4c9febd
Fix DriverStation API: static methods split into RobotState and Match…
nlaverdure Jul 3, 2026
eb9d5cf
Fix swerve kinematics API renames for WPILib 2027-alpha-6
nlaverdure Jul 3, 2026
3c67b5a
Fix Alliance and Color enum constant naming for WPILib 2027-alpha-6
nlaverdure Jul 3, 2026
6ff53ad
Fix Robot.java for WPILib 2027-alpha-6 HID and robot lifecycle API ch…
nlaverdure Jul 3, 2026
3c742da
Fix miscellaneous WPILib 2027-alpha-6 API renames
nlaverdure Jul 3, 2026
c88f0c8
Adapt SparkOdometryThread to REVLib 2027-alpha-4 Signal<Double> retur…
nlaverdure Jul 3, 2026
c25324d
Fix Spotless Google Java Format compatibility with JDK 25
nlaverdure Jul 3, 2026
8eb4fae
Update Spotless GJF to 1.35.0 for JDK 25 compatibility
nlaverdure Jul 3, 2026
69c7cd1
Apply GJF 1.35.0 formatting to all Java source files
nlaverdure Jul 3, 2026
d910ba4
Update CI workflows to JDK 25 for WPILib 2027 compatibility
nlaverdure Jul 3, 2026
331774d
Use Math.clamp() in ModuleIOSimWPI for WPILib 2027 compatibility
nlaverdure Jul 3, 2026
04ff5f2
Fix SparkOdometryThread error detection for REVLib Signal<Double> API
nlaverdure Jul 3, 2026
6f072dc
Use DriverStationBackend.JOYSTICK_PORTS instead of hardcoded 6
nlaverdure Jul 3, 2026
c339745
Use Timer.getTimestamp() instead of RobotController.getTime() / 1e6
nlaverdure Jul 3, 2026
9dc13e2
Replace magic literals with named constants and static imports
nlaverdure Jul 3, 2026
6caab41
Rename speeds to velocities throughout Drive and DriveCommands
nlaverdure Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/build-simulation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build (Simulation)

on:
push:

jobs:
build:
name: Build (Simulation)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
cache: gradle
- name: Grant execute permission
run: chmod +x gradlew
- name: Build simulation
run: ./gradlew assemble test
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Build
name: Build (SystemCore)

on:
push:

jobs:
build:
name: Build
name: Build (SystemCore)
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2024-22.04
container: wpilib/systemcore-cross-ubuntu-minimal:2027-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Grant execute permission
run: chmod +x gradlew
- name: Build robot code
run: ./gradlew build
run: ./gradlew assemble test
8 changes: 4 additions & 4 deletions .github/workflows/spotless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 17
distribution: 'temurin'
java-version: 25
- name: Change wrapper permissions
run: chmod +x ./gradlew
- run: ./gradlew spotlessCheck --stacktrace
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ deploy {
files = project.fileTree('src/main/deploy')
directory = '/home/systemcore/deploy'
deleteOldFiles = false // Change to true to delete files on systemcore that no
// longer exist in deploy directory of this project
// longer exist in deploy directory of this project
}
}
}
Expand Down Expand Up @@ -194,8 +194,7 @@ spotless {
include "**/*.java"
exclude "**/build/**", "**/build-*/**"
}
toggleOffOn()
googleJavaFormat()
googleJavaFormat('1.35.0')
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/game/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import static org.wpilib.units.Units.*;

import java.util.List;
import org.littletonrobotics.junction.Logger;
import org.wpilib.math.geometry.Pose2d;
import org.wpilib.math.geometry.Rectangle2d;
import org.wpilib.math.geometry.Rotation2d;
import org.wpilib.math.geometry.Translation2d;
import org.wpilib.units.measure.Distance;
import java.util.List;
import org.littletonrobotics.junction.Logger;

public class Field {
// Measured
Expand Down
27 changes: 14 additions & 13 deletions src/main/java/frc/game/GameState.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package frc.game;

import org.wpilib.wpilibj.DriverStation;
import org.wpilib.wpilibj.DriverStation.Alliance;
import frc.robot.Robot;
import java.util.List;
import java.util.Optional;
import org.littletonrobotics.junction.Logger;
import org.wpilib.driverstation.Alliance;
import org.wpilib.driverstation.MatchState;
import org.wpilib.driverstation.RobotState;

public class GameState {

Expand Down Expand Up @@ -43,10 +44,10 @@ private static int parseSeconds(String time) {
private static Alliance myAlliance;

public static GamePhase getCurrentPhase() {
if (!DriverStation.isDSAttached() && !DriverStation.isFMSAttached()) {
if (!RobotState.isDSAttached() && !RobotState.isFMSAttached()) {
return GamePhase.None;
}
if (DriverStation.isAutonomous()) {
if (RobotState.isAutonomous()) {
return GamePhase.Autonomous;
}
// Must be in match and teleop
Expand All @@ -61,29 +62,29 @@ public static GamePhase getCurrentPhase() {

public static Alliance getMyAlliance() {
if (myAlliance == null) {
// myAlliance = DriverStation.getAlliance().orElse(null);
// myAlliance = MatchState.getAlliance().orElse(null);
myAlliance = Robot.allianceSelector.getAllianceColor();
}
return myAlliance;
}

public static double getMatchTime() {
return DriverStation.getMatchTime();
return MatchState.getMatchTime();
}

public static Optional<Alliance> getAlliance() {
return DriverStation.getAlliance();
return MatchState.getAlliance();
}

public static void logValues() {
getMyAlliance();
Logger.recordOutput("GameState/IsDSAttached", DriverStation.isDSAttached());
Logger.recordOutput("GameState/IsFMSAttached", DriverStation.isFMSAttached());
Logger.recordOutput("GameState/MatchType", DriverStation.getMatchType());
Logger.recordOutput("GameState/IsAutonomus", DriverStation.isAutonomous());
Logger.recordOutput("GameState/MatchTime", DriverStation.getMatchTime());
Logger.recordOutput("GameState/IsDSAttached", RobotState.isDSAttached());
Logger.recordOutput("GameState/IsFMSAttached", RobotState.isFMSAttached());
Logger.recordOutput("GameState/MatchType", MatchState.getMatchType());
Logger.recordOutput("GameState/IsAutonomus", RobotState.isAutonomous());
Logger.recordOutput("GameState/MatchTime", MatchState.getMatchTime());
Logger.recordOutput("GameState/Alliance", myAlliance);
Logger.recordOutput("GameState/GameData", DriverStation.getGameSpecificMessage());
Logger.recordOutput("GameState/GameData", MatchState.getGameData().orElse(""));
Logger.recordOutput("GameState/CurrentPhase", getCurrentPhase());
}
}
10 changes: 5 additions & 5 deletions src/main/java/frc/lib/AllianceSelector.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package frc.lib;

import org.wpilib.wpilibj.DriverStation.Alliance;
import org.wpilib.wpilibj.event.BooleanEvent;
import org.wpilib.wpilibj.event.EventLoop;
import org.wpilib.commandsv2.button.Trigger;
import org.littletonrobotics.junction.Logger;
import org.wpilib.command2.button.Trigger;
import org.wpilib.driverstation.Alliance;
import org.wpilib.event.BooleanEvent;
import org.wpilib.event.EventLoop;

public class AllianceSelector {

Expand All @@ -26,7 +26,7 @@ public AllianceSelector(int port) {
* @return Whether the field is rotated from the driver's perspective
*/
public boolean fieldRotated() {
return inputs.allianceFromSwitch.equals(Alliance.Red);
return inputs.allianceFromSwitch.equals(Alliance.RED);
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/frc/lib/AllianceSelectorIO.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package frc.lib;

import org.wpilib.wpilibj.DigitalInput;
import org.wpilib.wpilibj.DriverStation;
import org.wpilib.wpilibj.DriverStation.Alliance;
import java.util.Optional;
import org.littletonrobotics.junction.AutoLog;
import org.wpilib.driverstation.Alliance;
import org.wpilib.driverstation.MatchState;
import org.wpilib.hardware.discrete.DigitalInput;

public class AllianceSelectorIO {

Expand All @@ -17,13 +17,13 @@ public AllianceSelectorIO(int port) {

@AutoLog
public static class AllianceSelectorIOInputs {
public Alliance allianceFromSwitch = Alliance.Red;
public Alliance allianceFromSwitch = Alliance.RED;
public boolean agreementInAllianceInputs = false;
public boolean allianceChanged = false;
}

public void updateInputs(AllianceSelectorIOInputs inputs) {
inputs.allianceFromSwitch = allianceSelectionSwitch.get() ? Alliance.Red : Alliance.Blue;
inputs.allianceFromSwitch = allianceSelectionSwitch.get() ? Alliance.RED : Alliance.BLUE;
inputs.agreementInAllianceInputs = agreementInAllianceInputs(inputs);
inputs.allianceChanged = changedAlliance(inputs);
}
Expand All @@ -39,7 +39,7 @@ private boolean changedAlliance(AllianceSelectorIOInputs inputs) {
}

private boolean agreementInAllianceInputs(AllianceSelectorIOInputs inputs) {
Optional<Alliance> allianceFromFMS = DriverStation.getAlliance();
Optional<Alliance> allianceFromFMS = MatchState.getAlliance();
if (allianceFromFMS.isPresent()) {
return inputs.allianceFromSwitch.equals(allianceFromFMS.get());
} else return false;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/lib/AutoOption.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package frc.lib;

import choreo.trajectory.SwerveSample;
import org.wpilib.math.geometry.Pose2d;
import org.wpilib.wpilibj.DriverStation.Alliance;
import org.wpilib.wpilibj.util.Color;
import org.wpilib.commandsv2.Command;
import frc.robot.auto.AutoMode;
import java.util.Optional;
import org.wpilib.command2.Command;
import org.wpilib.driverstation.Alliance;
import org.wpilib.math.geometry.Pose2d;
import org.wpilib.util.Color;

public class AutoOption {
private final Alliance allianceColor;
Expand Down Expand Up @@ -61,7 +61,7 @@
* @return The command which runs the selected autonomous mode
*/
public synchronized Optional<Command> getAutoCommand() {
return (autoMode == null) ? Optional.empty() : Optional.of(autoMode.getAutoRoutine().cmd());

Check failure on line 64 in src/main/java/frc/lib/AutoOption.java

View workflow job for this annotation

GitHub Actions / Build (Simulation)

cannot access Command
}

public Optional<Pose2d> getInitialPose() {
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/frc/lib/AutoSelector.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package frc.lib;

import org.wpilib.math.geometry.Pose2d;
import org.wpilib.wpilibj.DriverStation.Alliance;
import org.wpilib.wpilibj.event.BooleanEvent;
import org.wpilib.wpilibj.event.EventLoop;
import org.wpilib.commandsv2.Command;
import org.wpilib.commandsv2.button.Trigger;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;
import org.littletonrobotics.junction.Logger;
import org.wpilib.command2.Command;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.command2.button.Trigger;
import org.wpilib.driverstation.Alliance;
import org.wpilib.event.BooleanEvent;
import org.wpilib.event.EventLoop;
import org.wpilib.math.geometry.Pose2d;

public class AutoSelector implements Supplier<Optional<AutoOption>> {

Expand Down Expand Up @@ -72,8 +73,8 @@

/** Schedules the command corresponding to the selected autonomous mode */
public void scheduleAuto() {
// TODO: schedule() in Command has been deprecated and marked for removal
currentAutoOption.ifPresent(ao -> ao.getAutoCommand().ifPresent(Command::schedule));
currentAutoOption.ifPresent(
ao -> ao.getAutoCommand().ifPresent(CommandScheduler.getInstance()::schedule));
}

/** Deschedules the command corresponding to the selected autonomous mode */
Expand All @@ -93,7 +94,7 @@
lastLoggedTrajectoryOption = ao;
ao.getInitialTrajectory()
.ifPresent(
traj -> Logger.recordOutput("AutoSelector/AutonomousInitialTrajectory", traj));

Check failure on line 97 in src/main/java/frc/lib/AutoSelector.java

View workflow job for this annotation

GitHub Actions / Build (Simulation)

cannot access Interpolatable
}
ao.getInitialPose()
.ifPresent(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/lib/AutoSelectorIO.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package frc.lib;

import org.wpilib.wpilibj.DigitalInput;
import org.littletonrobotics.junction.AutoLog;
import org.wpilib.hardware.discrete.DigitalInput;

public class AutoSelectorIO {

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/lib/CommandZorroController.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package frc.lib;

import org.wpilib.wpilibj.event.EventLoop;
import org.wpilib.commandsv2.CommandScheduler;
import org.wpilib.commandsv2.button.CommandGenericHID;
import org.wpilib.commandsv2.button.Trigger;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.command2.button.CommandGenericHID;
import org.wpilib.command2.button.Trigger;
import org.wpilib.event.EventLoop;

/**
* A version of {@link ZorroController} with {@link Trigger} factories for command-based.
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/lib/ControllerSelector.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package frc.lib;

import org.wpilib.wpilibj.DriverStation;
import org.wpilib.wpilibj.GenericHID;
import org.wpilib.commandsv2.CommandScheduler;
import frc.robot.Constants;
import frc.robot.Constants.Mode;
import java.util.Objects;
import java.util.Set;
import org.littletonrobotics.junction.Logger;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.driverstation.GenericHID;
import org.wpilib.driverstation.internal.DriverStationBackend;

/**
* Manages the selection and binding of controllers for driver and operator roles as a singleton.
Expand Down Expand Up @@ -172,7 +172,7 @@ public OperatorConfig(
}
}

private static final int NUM_CONTROLLER_PORTS = DriverStation.kJoystickPorts;
private static final int NUM_CONTROLLER_PORTS = DriverStationBackend.JOYSTICK_PORTS;

private final ControllerConfig[] controllerConfigs;
private final GenericHID[] controllers;
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/frc/lib/LoggedCompressor.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
package frc.lib;

import org.wpilib.wpilibj.Compressor;
import org.wpilib.wpilibj.PneumaticsModuleType;
import org.littletonrobotics.junction.Logger;
import org.wpilib.hardware.pneumatic.Compressor;
import org.wpilib.hardware.pneumatic.PneumaticsModuleType;

public class LoggedCompressor extends Compressor {
private final String key;

public LoggedCompressor(PneumaticsModuleType moduleType, String logKey) {
super(moduleType);
/**
* Creates a logged compressor.
*
* @param busId the CAN bus ID (SystemCore transceiver number)
* @param moduleType the type of pneumatics module
* @param logKey the AdvantageKit log key prefix
*/
public LoggedCompressor(int busId, PneumaticsModuleType moduleType, String logKey) {
super(busId, moduleType);
this.key = logKey;
}

Expand Down
14 changes: 11 additions & 3 deletions src/main/java/frc/lib/LoggedPowerDistribution.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
package frc.lib;

import org.wpilib.wpilibj.PowerDistribution;
import org.littletonrobotics.junction.Logger;
import org.wpilib.hardware.power.PowerDistribution;

public class LoggedPowerDistribution extends PowerDistribution {
private final String key;

public LoggedPowerDistribution(int module, ModuleType moduleType, String logKey) {
super(module, moduleType);
/**
* Creates a logged power distribution module.
*
* @param busId the CAN bus ID (SystemCore transceiver number)
* @param module the CAN device ID of the power distribution module
* @param moduleType the type of power distribution module
* @param logKey the AdvantageKit log key prefix
*/
public LoggedPowerDistribution(int busId, int module, ModuleType moduleType, String logKey) {
super(busId, module, moduleType);
this.key = logKey;
}

Expand Down
Loading
Loading