An FRC (FIRST Robotics Competition) robot project using WPILib 2025, AdvantageKit for logging, and CTRE Phoenix 6 for motor control. The project follows a command-based architecture with IO abstraction layers for hardware components.
- Swerve Drive - Full swerve drive system with module control
- AdvantageKit Logging - Comprehensive logging and log replay support
- IO Abstraction - Hardware-independent subsystem design for easy testing and simulation
- PathPlanner Integration - Autonomous path following
- LimeLight - Camera and vision processing for target tracking
- Elastic Dashboard - Using Elastic dashboard for logging and competition purposes instead of Shuffleboard or Driverstation.
- WPILib 2025 installed (includes Java JDK 17)
- Visual Studio Code with WPILib extension (recommended)
# Build the project
./gradlew build
# Run tests
./gradlew test
# Format code (Spotless)
./gradlew spotlessApply
# Check formatting
./gradlew spotlessCheck
# Deploy to RoboRIO
./gradlew deploy
# Run simulation
./gradlew simulateJava
# Log replay
./gradlew replayWatchNote: On Windows, if JAVA_HOME is not configured, use:
JAVA_HOME="C:/Users/Public/wpilib/2025/jdk" ./gradlew buildsrc/main/java/frc/robot/
├── Main.java # Entry point
├── Robot.java # LoggedRobot, initializes AdvantageKit
├── RobotContainer.java # Subsystems, commands, button bindings
├── Constants.java # Global constants
├── subsystems/
│ ├── drive/ # Swerve drive system
│ ├── intake/ # Game piece intake
│ ├── shooter/ # Shooting mechanism
│ ├── superstructure/ # Coordinated subsystem control
│ └── vision/ # Camera and vision processing
└── commands/ # Robot commands
Each subsystem follows an IO abstraction pattern for hardware independence:
- Subsystem Class - Core logic and command interface (e.g.,
Drive.java) - IO Interface - Hardware abstraction layer (e.g.,
DriveIO.java) - IO Implementations:
- Real hardware (e.g.,
DriveIOTalonFX.java) - Simulation (e.g.,
DriveIOSim.java)
- Real hardware (e.g.,
This pattern enables:
- Unit testing without hardware
- Full simulation support
- Easy hardware swaps
- AdvantageKit log replay
- WPILib 2025.3.2
- CTRE Phoenix 6
- AdvantageKit
- PathPlanner
- PhotonLib
- Maple-sim
Phoenix 6 uses typed units, not raw doubles:
// Correct usage
StatusSignal<Angle> positionSignal = motor.getPosition();
double rotations = positionSignal.getValue().in(Units.Rotations);
// Incorrect - won't compile
StatusSignal<Double> positionSignal = motor.getPosition();Current limits use SupplyCurrentLimit and StatorCurrentLimit (not threshold-based limits).