Will the new release include a modified AdvantageKit Talon FX template with maple-sim?
Yes, the AdvantageKit TalonFX template with maple-sim is already here.
I will update the dependencies to latest 2025 version (including wpilib, path planner and maple-sim).
Maple-Sim Beta 2: Reefscape!
As teams DIVE IN to the new Reefscape season, we are excited to present the latest release of Maple-Sim!
New Season, New Game
With the updated playing field and game elements, Maple-Sim is fully equipped to power your software development for the new season! Check out the Reefscape Simulation Notes for detailed information on season-specific simulations for the 2025 game.
What’s Changed
- Update pull request template by @GrahamSH-LLK in #77
- Fix a few typos in docs by @GrahamSH-LLK in #76
- Update build.gradle by @thenetworkgrinch in #79
- Reefscape! by @catr1xLiu in #80
Full Changelog: Comparing v0.2.8...v0.3.0 · Shenzhen-Robotics-Alliance/maple-sim · GitHub
What’s Next?
The following will be available later this week:
-
New AdvantageKit Swerve Templates
In the Kick-Off Release of AdvantageKit (V4.0.0), the AdvantageKit Swerve Templates have received several upgrades. We will be integrating these upgrades into our modified version of AdvantageKit Swerve Templates with Maple-Sim integration so that teams can easily use them for the new season.
-
CTRE Generated Swerve Project Simulation Support
We will provide a modified version of the CTRE Generated Swerve Project to allow teams using it to take full advantage of Maple-Sim’s enhanced simulation capabilities.
Note: This is Maple-Sim’s first season. The development process will continue as teams use it throughout the season. Expect occasional instability, bugs, and API changes as we deliver updates. If you have any questions or concerns, please feel free to contact us on discord or submit an issue on GitHub—we’re here to help!
Are there any plans to add python support?
Currently, maplesim uses dyn4j, which is a java library, so python/c++ support isn’t possible as of now. I’m not sure if catrix is considering it at a later time, however.
This is really cool!
Is it possible that when algae is scored in the net, it will stay there instead of disappear – and possibly interact with other algae already in the net?
Excited to use this with yagsl. Any way to allow for coral to go down the station in either orientation?
Unfortunately, as @Daniel1464 mentioned, Maple-Sim cannot support Python due to the limitations of the libraries it is based on.
Yes, that’s definitely possible! We could use the Dyn4j physics engine to simulate the interactions between algae when they are in the NET. However, I might not have time to work on that this week. It would be awesome if you could implement that yourself and submit a pull request!
Yes, you can use SimulatedArena.getInstance().addGamePiece()
in your user code to achieve that.
Note that when placing algae (which is a ball), you only need to specify the position. For coral, however, both position and orientation need to be specified.
SimulatedArena.getInstance().addGamePiece(new ReefscapeAlgaeOnField(
new Translation2d(2,2)
));
SimulatedArena.getInstance().addGamePiece(new ReefscapeCoral(
// places the coral in 45-deg angle
new Pose2d(2, 2, Rotation2d.fromDegrees(45))
));
v0.3.1: Some Small Improvement
Akit swerve template upgrades
Upgraded all AdvantageKit Swerve Templates to their latest version as being published in the AdvantageKit Kickoff release, and upgraded maple-sim in these templates to latest version.
- AKitSparkSwerveTemplate-maple-sim: The AdvantageKit Swerve Template with REV SparkMax hardware, enhanced with maple-sim integration for improved chassis physics simulation.
- AkitTalonSwerveTemplate-maple-sim: The AdvantageKit Swerve Template with CTRE hardware, enhanced with maple-sim integration for improved chassis physics simulation.
- AkitTalonSwerveTemplate_EnhancedPhoenixSimulation: 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. (Note: This project is in the dev branch, and the work is still in progress.)
Coral-Algae stack improvements
- Improved the way users visualize the Algae-Coral stacks. Previously, users had to call
to visualize algae in the stack.Logger.recordOutput("FieldSimulation/StackedAlgae", ReefscapeCoralAlgaeStack.getStackedAlgaePoses());
Now, all the algae and coral in the stack will be displayed automatically when callingLogger.recordOutput("FieldSimulation/Algae", SimulatedArena.getInstance().getGamePiecesArrayByType("Algae")); Logger.recordOutput("FieldSimulation/Coral", SimulatedArena.getInstance().getGamePiecesArrayByType("Coral"));
IntakeSimulation
s that intakes “Coral” or “Algae” game pieces can now interact with the stack.- When an activated
IntakeSimulation
that intakes “Coral” contacts with a Coral-Algae stack, the CORAL is obtained by the intake and the ALGAE will automatically fall to the ground. - When an activated
IntakeSimulation
that intakes “Algae” contacts with a Coral-Algae stack, the ALGAE is obtained by the intake and the CORAL will automatically fall to the ground.
- When an activated
Self-controlled module simulation SysId function
Two functions have been added to SelfControlledModuleSimulation
:
-
runDriveMotorCharacterization(Rotation2d desiredModuleFacing, double volts)
-
runSteerMotorCharacterization(double volts)
This will allow users to run SysId characterizations on drive and steer motors during simulation!
Changelog
- Update build.gradle by @thenetworkgrinch in #81
- Akit swerve template upgrades in #83
- Coral-Algae stacks improvements in #83
- SysId for
SelfControlledModuleSimulation
in #83
Full Changelog: Comparing v0.3.0...v0.3.1 · Shenzhen-Robotics-Alliance/maple-sim · GitHub
Can you explain a bit more about the difference between the regular CTRE template and the Enhance one?
Absolutely! The difference lies in how they simulate motor behavior.
The swerve templates run closed loops on motors. However, since there is no actual motor during the simulation, we must simulate how motor controllers execute user commands.
The regular swerve template uses PIDController
and SimpleMotorFeedforward
from WPILib to simulate motor controllers. While this mimics the behavior, it’s not 100% accurate.
The enhanced template, however, uses Phoenix 6’s simulation feature for a more accurate simulation of CTRE motor controllers, closely matching real-world performance.
TL;DR: The regular template is enough, use the enhanced one for a more accurate simulation.
Join Our Discord Server (PermanentLink)
For further discussion on development or to get help, please join our Discord community:Maple-Sim
CTRE Generated Swerve Project with Maple-Sim - Finally Here!
This work is inspired by and based on Team 5104 “The Breakerbots”'s Custom Library - BreakerLib. Thank you, @Roman-Tech-Plus, for your creativity and generosity!
Why did it take so long?
We started in late November, so you might wonder why we're only releasing it now in January.
Alright, I'll admit it—one big reason was my laziness (LMAO).
We also ran into technical challenges with internal bugs in PhoenixLib, which caused motor simulation failures. To make matters worse, the CTRE Swerve API and Phoenix library function like black boxes. Without access to intermediate variables, debugging the simulation was a tough task.
Fortunately, most of the simulation bugs were resolved during PhoenixLib's kickoff. While a few small glitches remain, they can be avoided by tweaking some configurations during simulation.
TL;DR: I was lazy, and we faced technical challenges, but we nailed it! (YEAH! )
Thank you for your patience, and sorry for the long wait!
For guidance on installation and usage, please visit the Project Page.
We’ve also upgraded WPILib and PathPlanner to their latest versions across all template projects. The AdvantageKit Talon Swerve Template with enhanced CTRE simulation is now fully ready for use! Check out our template projects.
@catrix Hey! My laziness helped (or rather hindered) too!