Home
Elevating FRC Java Robot Simulations to the Next Level with Physics Engines
Why a Physics Engine?
A simulation engine is a powerful tool that provides realistic approximations of physical systems. With maple-sim, we integrate the open-source Java rigid-body dynamics engine, dyn4j, capable of simulating 2D forces and collisions between rigid shapes. This integration transforms the scope of robot simulations by enabling realistic interactions between robots, field elements, and game pieces.
Before maple-sim, most FRC robot simulations focused solely on the robot itself—its sensors, movements, and internal operations. Now, through the power of physics simulation, maple-sim allows your robot to engage directly with its environment. Imagine testing robot interactions with obstacles, field elements, and game pieces, all within the simulated world. A simulation that is realistic enough to feel like a video game.
With this advanced level of simulation, the possibilities are endless. You can:
- Test autonomous modes with pinpoint accuracy.
- Fine-tune advanced TeleOp enhancement features like pathfinding-auto-alignment.
- Optimize shooters and other subsystems, all while gathering meaningful data from simulated physics.
And the best part? You can achieve all of this without needing a real robot on hand!
Simulation Details
For an in-depth description of the simulations, please refer to Simulation Details
Getting Started With Templates
-
CTRE Generated Swerve Code
The CTRE Generated Swerve Code, enhanced with maple-sim integration for improved chassis physics simulation.
-
YAGSL
Maple-sim is officially included in the amazing Yet Another Generic Swervedrive Library (YAGSL) for 2025!
-
AdvantageKit SparkMax Swerve Template
The AdvantageKit Swerve Template with REV SparkMax hardware, enhanced with maple-sim integration for improved chassis physics simulation.
-
AdvantageKit Talon Swerve Template
The AdvantageKit Swerve Template with CTRE hardware, enhanced with maple-sim integration for improved chassis physics simulation.
-
AdvantageKit Talon Swerve Template - Enhanced Version
A further enhanced version of the TalonSwerveTemplate-maple-sim project, utilizing Phoenix 6 simulation to simulate CTRE motor controller closed-loops and the CAN bus
-
Base Talon Swerve
Base-Talon-Swerve, modified with advanced drivetrain simulation. This is an example implementation of the Simplified Swerve Simulation.
Other Custom Templates & Examples
Maple-Swerve-Skeleton: Our custom swerve drive project based on the Advanced Swerve Drive Project, featuring drivetrain simulation, vision simulation, and convenient control features.
5516-2024-OffSeason-RobotCode: Our 2024 off-season robot code, which implements a range of advanced simulations. This code can be run on a real robot and even played like a video game. Watch the Videos
Online Documentation
Please follow the guides below for quick setup:
- Installing maple-sim
- Using the Simulated Arena
- Simulating Swerve Drivetrain
- Simulating Intake
- Simulating Projectiles
- Simulating Opponent Robots
🙏 Big thanks to @GrahamSH-LLK for all the help in setting up the online documentation.
Java Docs
🙏 Big thanks to @nstrike for all the help in setting up the Java Docs.
Reporting Bugs, Developing and Contributing
Reporting Bugs
If you've encountered a bug while using maple-sim in your robot code, please submit an issue and select the "Bug Report" option. We review issues regularly and will respond as quickly as possible.
Suggestions & Improvements
- If you have an idea for a new feature, please submit an issue and select the "Feature Request" option.
- If you think the API for an existing feature could be improved for better readability or usability, please submit an issue and select the "API Enhancement" option.
Contributing
For detailed guidelines on contributing to the project, please refer to the contribution guide.