wpilibsuite / frc-docs

Official FRC Documentation powered by Read the Docs
https://docs.wpilib.org
Other
145 stars 260 forks source link

Update Swerve Simulation Support Status #2406

Open jasondaming opened 9 months ago

jasondaming commented 9 months ago

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.

virtuald commented 9 months ago

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

calcmogul commented 9 months ago

That looks like what the SwerveDriveKinematics class already does.

jasondaming commented 9 months ago

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

calcmogul commented 9 months ago

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.