From 1f2634978e6cb87f0b14d5c5ea336992d2b88575 Mon Sep 17 00:00:00 2001 From: jace rodgers Date: Tue, 14 Jan 2025 13:56:25 -0600 Subject: [PATCH] changed sim conversions --- src/main/java/frc/lib/util/swerve/SwerveModuleSim.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/lib/util/swerve/SwerveModuleSim.java b/src/main/java/frc/lib/util/swerve/SwerveModuleSim.java index 8136451..e95922d 100644 --- a/src/main/java/frc/lib/util/swerve/SwerveModuleSim.java +++ b/src/main/java/frc/lib/util/swerve/SwerveModuleSim.java @@ -1,6 +1,7 @@ package frc.lib.util.swerve; import static edu.wpi.first.units.Units.Meters; +import static edu.wpi.first.units.Units.RadiansPerSecond; import static edu.wpi.first.units.Units.Rotations; import static edu.wpi.first.units.Units.RotationsPerSecond; import static edu.wpi.first.units.Units.Seconds; @@ -50,7 +51,8 @@ public void setModNumber(int number) { public void updateInputs(SwerveModuleInputs inputs) { driveSim.update(LoggedRobot.defaultPeriodSecs); AngularVelocity driveSpeed = - RotationsPerSecond.of(Units.radiansToRotations(driveSim.getAngularVelocityRadPerSec())); + RadiansPerSecond.of(driveSim.getAngularAccelerationRadPerSecSq()); + RotationsPerSecond.of(Units.radiansToRotations(driveSim.getAngularVelocityRadPerSec())); this.distance = driveSpeed.times(Seconds.of(LoggedRobot.defaultPeriodSecs)).plus(distance); inputs.driveMotorSelectedPosition = this.distance; inputs.driveMotorSelectedSensorVelocity = driveSpeed;