FRC Team 4079's repository for the 2025 REEFSCAPE robot code. Our robot is designed for competitive play in the 2025 FRC season, featuring advanced swerve drive, multi-level scoring capabilities, and comprehensive autonomous routines.
- Overview
- Robot Architecture
- Subsystems
- Project Structure
- Dependencies
- Setup & Installation
- Building & Deployment
- Development Guidelines
- Autonomous Modes
- Controls
- Logging & Telemetry
- Testing
- Contributing
- License
Team: 4079
Competition: FIRST Robotics Competition 2025 - REEFSCAPE
Primary Language: Kotlin (with Java support)
Control System: RoboRIO with WPILib
- Swerve Drive System - High-precision movement and field-centric control
- Multi-Level Elevator - L1-L4 scoring positions with automated positioning
- Advanced Vision System - PhotonVision integration for autonomous targeting
- Comprehensive Logging - AdvantageKit integration for detailed match analysis
- Autonomous Pathfinding - PathPlanner integration with custom A* implementation
The robot code follows a command-based architecture using WPILib's Command framework, enhanced with Kotlin's modern language features:
Robot.kt (Main Robot Class)
├── RobotContainer.kt (Command binding and autonomous selection)
├── Subsystems/ (Hardware abstraction layer)
├── Commands/ (Robot behaviors and sequences)
└── Utils/ (Helper classes and constants)
- WPILib 2025 - Robot control framework
- AdvantageKit - Advanced logging and replay system
- PathPlanner - Autonomous path planning and following
- Phoenix 6 - CTRE motor controller framework
- PhotonVision - Computer vision processing
- Type: Swerve drive with 4 modules
- Motors: TalonFX drive and steering motors
- Features:
- Field-centric and robot-centric control modes
- Odometry integration with vision fusion
- Auto-alignment capabilities
- Pathfinding integration
- Purpose: Multi-level scoring mechanism
- Positions: L1, L2, L3, L4, and DEFAULT
- Features:
- PID-controlled positioning
- Soft limits and safety mechanisms
- Automated state management
- Purpose: Game piece collection
- Features:
- Variable speed control
- Sensor-based piece detection
- Integration with elevator system
- Purpose: Game piece scoring
- Features:
- Multiple scoring modes
- State-based control system
- Coordinated with elevator positioning
- Purpose: Coordinate multiple subsystems
- Features:
- High-level command sequencing
- State machine management
- Automated scoring sequences
- Purpose: Computer vision for autonomous targeting
- Features:
- AprilTag detection and tracking
- Pose estimation integration
- Real-time target alignment
- Purpose: Visual feedback and status indication
- Features:
- Robot state indication
- Match status display
- Debug information visualization
src/main/java/frc/robot/
├── Robot.kt # Main robot class
├── RobotContainer.kt # Command bindings and auto selection
├── Main.java # Robot entry point
├── commands/ # Robot commands and sequences
│ ├── AlignToPose.kt # Vision-based alignment
│ ├── Sequences.kt # Automated command sequences
│ ├── Calibration.kt # System calibration routines
│ └── ...
├── subsystems/ # Hardware subsystems
│ ├── Swerve.kt # Swerve drive system
│ ├── Elevator.kt # Multi-level elevator
│ ├── Intake.kt # Game piece intake
│ ├── Outtake.kt # Scoring mechanism
│ └── ...
└── utils/ # Utility classes and constants
├── RobotParameters/ # Configuration constants
└── emu/ # Custom utility classes
vendordeps/ # Third-party dependencies
├── AdvantageKit.json
├── PathplannerLib-2025.2.3.json
├── Phoenix6-25.2.2.json
└── ...
src/main/deploy/ # Files deployed to robot
build.gradle # Build configuration
gradle.properties # Project properties
- WPILib 2025 - Robot control framework
- GradleRIO - Build and deployment system
- Kotlin JVM - Primary programming language
- AdvantageKit - Advanced logging and data analysis
- PathPlannerLib 2025.2.3 - Autonomous path planning
- Phoenix 6 (25.2.2) - CTRE motor controller support
- PhotonLib - Computer vision integration
- WPILib New Commands - Enhanced command framework
- Spotless - Code formatting and style enforcement
- Dokka - Kotlin documentation generation
- Java Development Kit (JDK) 17+
- WPILib 2025 development environment
- Git for version control
-
Clone the repository:
git clone https://github.com/your-org/Reefscape-2025-Offseason.git cd Reefscape-2025-Offseason -
Install WPILib 2025:
- Download from WPILib Releases
- Follow the installation guide for your platform
-
Open in VS Code:
- Open the project folder in WPILib VS Code
- The project should automatically configure dependencies
Set your team number in .wpilib/wpilib_preferences.json:
{
"teamNumber": 4079
}# Build the project
gradlew build
# Run code formatting
gradlew spotlessApply
# Generate documentation
gradlew dokkaHtml# Deploy to RoboRIO (robot must be connected)
gradlew deploy
# Deploy with debug information
gradlew deploy -Pdebug=true# Run robot simulation
gradlew simulateJava
# Run with GUI
gradlew simulateJava -Pheadless=false- Language: Primarily Kotlin, Java for compatibility where needed
- Formatting: Enforced by Spotless (run
gradlew spotlessApply) - Naming: Use descriptive names, follow Kotlin conventions
- Documentation: Document public APIs and complex logic
- Create feature branches from
main - Make atomic commits with descriptive messages
- Test thoroughly before submitting pull requests
- Code review required before merging
- Unit tests for utility functions
- Simulation testing for robot behaviors
- Hardware-in-the-loop testing when possible
- ScoreL4Left - Score at L4 position from left side
- ScoreL4Right - Score at L4 position from right side
- Multi-piece routines - Various multi-game piece sequences
- Uses PathPlanner for trajectory generation
- Custom A* pathfinding implementation for dynamic obstacles
- Real-time path optimization based on field conditions
- Left Stick: Translation (X/Y movement)
- Right Stick: Rotation
- Triggers: Speed modulation
- Buttons: Field-centric toggle, auto-alignment
- Elevator Control: Manual and preset positioning
- Intake/Outtake: Game piece manipulation
- Automated Sequences: One-button scoring routines
- Comprehensive data logging for match analysis
- Replay capability for debugging
- Real-time telemetry visualization
- All subsystem states and sensor readings
- Command execution traces
- Performance metrics and diagnostics
- Vision processing results
Use AdvantageScope to analyze logged data:
- Connect to robot or load log files
- Configure custom layouts for different analysis needs
- Export data for further analysis
# Run basic simulation
gradlew simulateJava
# Run with specific robot configuration
gradlew simulateJava -Probot=competition- Subsystem calibration routines available in
Calibration.kt - Individual subsystem testing through SmartDashboard
- Full system integration testing
- Fork the repository
- Create a feature branch
- Make your changes following the development guidelines
- Test thoroughly
- Submit a pull request
- All changes require review by team leads
- Automated checks must pass (build, formatting, basic tests)
- Hardware testing required for subsystem changes
- Use GitHub Issues for bug reports and feature requests
- Provide detailed reproduction steps for bugs
- Include relevant log files when applicable
This project is licensed under the terms of the WPILib License. See the WPILib-License.md file for details.