Closed oh-yes-0-fps closed 1 day ago
Most of the code looks impressive me, can you please test the new API in advanced_swerve_example so that we can see how the new API works in real-life code?
Also, please change the target of the PR to https://github.com/Shenzhen-Robotics-Alliance/maple-sim/tree/new-game-piece-API
thanks a lot for contributing!
The whole library has moved to wpilib units, this means that merging it using git is seemingly impossible.
I'll just merge it to a temporary branch and manually commit changes to dev
instead.
Anyways, thanks a lot for all the work! I really like it!
I had some time to burn so I refactored the library to roughly how I would do it. Feel free to tell me what you like and don't like.
This is an implementation of the
SimRobot
idea we talked about a week ago.The user would grab the robot from the simulation arena and can either pass it throughout their subsystems or statically access it. The user then uses this robot to initialize their drivetrain sim, gamepiece storage, mechanisms/motors and intakes.
A somewhat comprehensive list of changes:
MapleMotorSim
toMechanismSim
SwerveDriveTrainSimulation
now has it's ownSwerveConfig
that extends the base configGamePieceStorage
object that can be shared between intakes and other subsystemsGamePiece
changes from previous PRGamePiece
now has a user control invariance that only lets user mutating functions work if they should have control over theGamePiece
IntakeSimulation
,MechanismSim
,GamePieceStorage
, andDriveTrainSimulation
are all constructed throughSimRobot
nowGamePiece
s can be cleared from the arena based on their current state (aka clear all Limbo)SimulatedArena
timing methods are now non-staticRuntimeLog
for better user feedback on warnings/errors