Update Swerve Simulation Support Status
This article references this PR which has been closed. We should update it to reflect our current thoughts on swerve simulation.
IMO we should think about including "perfect" swerve simulation. While it isn't accurate for testing real world effects of swerve it is extremely useful for testing things like basic driver control and automated pathing.
FWIW pyfrc's physics module includes a 'perfect' four motor swerve drivetrain object for simulation. https://github.com/robotpy/pyfrc/blob/b8472df58739031b60c384f3304c6cb56e582f19/pyfrc/physics/drivetrains.py#L318
That looks like what the SwerveDriveKinematics class already does.
Are you talking about this?
Are you just saying that all of the "math" is already there?
I was suggesting that there should be a SwerveDrivetrainSim similar to how there is a DifferentialDrivetrainSim
Are you just saying that all of the "math" is already there?
Yes.
I was suggesting that there should be a SwerveDrivetrainSim similar to how there is a DifferentialDrivetrainSim
We could, though it'll just be a thin wrapper around SwerveDriveKinematics.
Maple-sim implements swerve drive simulation, so we could link there instead of implementing it in WPILib.