frc-docs icon indicating copy to clipboard operation
frc-docs copied to clipboard

Update Swerve Simulation Support Status

Open jasondaming opened this issue 2 years ago • 5 comments

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.

jasondaming avatar Nov 26 '23 19:11 jasondaming

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

virtuald avatar Nov 26 '23 20:11 virtuald

That looks like what the SwerveDriveKinematics class already does.

calcmogul avatar Nov 26 '23 22:11 calcmogul

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

jasondaming avatar Nov 27 '23 16:11 jasondaming

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.

calcmogul avatar Nov 27 '23 16:11 calcmogul

Maple-sim implements swerve drive simulation, so we could link there instead of implementing it in WPILib.

UserC2 avatar Jan 16 '25 21:01 UserC2