A FIRST Robotics Competition (FRC) robot code project featuring QuestNav vision-based pose estimation integrated with a swerve drive system. This robot demonstrates advanced autonomous navigation capabilities using QuestNav's computer vision technology.
- QuestNav Vision System: Advanced pose estimation using QuestNav's computer vision technology
- Swerve Drive: Four-wheel independent steering and driving for omnidirectional movement
- Path Planning: Integration with PathPlanner for autonomous path following
- AdvantageKit Logging: Comprehensive data logging and analysis capabilities
- Simulation Support: Full physics simulation support for testing and development
- Closed-Loop Control: PID-based heading control and balance control systems
- Type: Swerve Drive (4 modules)
- Max Speed: 4.8 m/s
- Track Width: 0.395m
- Wheel Base: 0.370m
- Wheel Radius: 1.5 inches
- Motors: NEO brushless motors for drive, NEO 550 for steering
- Encoders: Integrated encoders with gear reduction
- Vision System: QuestNav computer vision for pose estimation
- Tracking: Real-time robot pose tracking with sub-inch accuracy
- Latency: Low-latency pose updates for responsive control
- Battery Monitoring: QuestNav device battery level tracking
- WPILib 2025.3.2: FRC robotics framework
- AdvantageKit 4.1.2: Advanced logging and analysis
- QuestNavLib 2025-1.1.1-beta: Vision-based pose estimation
- PathPlanner: Autonomous path planning and following
- CTRE Phoenix 6: Motor controller libraries
- REVLib: REV Robotics motor controller support
- Java 17: Programming language
- Gradle: Build system
- Spotless: Code formatting
- JUnit 5: Testing framework
src/main/java/frc/robot/
โโโ Robot.java # Main robot class
โโโ RobotContainer.java # Robot configuration and controls
โโโ Constants.java # Runtime mode configuration
โโโ commands/
โ โโโ DriveCommands.java # Drive control commands
โ โโโ QuestNavDiagnostics.java
โ โโโ QuestNavClosedLoopControl.java
โโโ subsystems/
โโโ drive/ # Swerve drive subsystem
โ โโโ Drive.java
โ โโโ DriveConstants.java
โ โโโ Module.java
โ โโโ GyroIO*.java # Gyroscope implementations
โโโ questnav/ # QuestNav vision subsystem
โโโ QuestNavSubsystem.java
- Left Stick: Forward/backward and strafe movement
- Right Stick: Rotation control
- A Button: Toggle QuestNav mode
- B Button: Toggle smooth drive mode
- X Button: Reset robot pose
- Y Button: QuestNav diagnostics
- Start Button: Reset gyroscope
- Back Button: Reset pose estimation
- PathPlanner Integration: Pre-programmed autonomous paths
- QuestNav Pose Estimation: Vision-based autonomous navigation
- Closed-Loop Control: PID-based heading and balance control
- WPILib 2025.3.2 or later
- Java 17 or later
- Gradle (included with WPILib)
- QuestNav Device with QuestNavLib integration
-
Clone the repository:
git clone https://github.com/your-team/2025-QuestNav-Java-Robot.git cd 2025-QuestNav-Java-Robot -
Open the project in VS Code with the WPILib extension
-
Configure your team number in
.wpilib/wpilib_preferences.json -
Set up QuestNav device according to QuestNav documentation
- CAN IDs: Configured in
DriveConstants.java- Drive Motors: 11, 21, 31, 41
- Turn Motors: 12, 22, 32, 42
- Pigeon IMU: 99
./gradlew build./gradlew deploy./gradlew simulate./gradlew testThis project uses AdvantageKit for comprehensive data logging:
- Real Robot: Logs to USB drive at
/U/logs - Simulation: Logs to NetworkTables
- Replay: Supports log file replay for analysis
- QuestNav pose estimation
- Drive system telemetry
- Motor controller data
- Gyroscope readings
- Control system outputs
The robot supports full physics simulation for testing without hardware:
- Swerve drive physics simulation
- QuestNav pose estimation simulation
- PathPlanner integration testing
Use the QuestNav diagnostics command to:
- Test QuestNav connectivity
- Monitor tracking status
- Verify pose estimation accuracy
- Check device battery levels
Key parameters in DriveConstants.java:
- Motor current limits
- PID controller gains
- Rate limiting values
- QuestNav-specific tuning parameters
- Camera transform calibration
- Tracking sensitivity
- Pose estimation filtering
- Anti-oscillation parameters
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and formatting
- Submit a pull request
This project uses Spotless for code formatting:
- Google Java Format
- Automatic import organization
- Trailing whitespace removal
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Mechanical Advantage for the AdvantageKit framework
- QuestNav for the vision-based pose estimation system
- WPILib for the FRC robotics framework
- PathPlanner for autonomous path planning capabilities
For questions and support:
- Create an issue in this repository
- Contact the development team
- Check the QuestNav documentation
Team: [Your Team Name] Year: 2025 Competition: FIRST Robotics Competition