Skip to content

Commit

Permalink
changed sim conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
txrnqt committed Jan 14, 2025
1 parent ab0507e commit 1f26349
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/frc/lib/util/swerve/SwerveModuleSim.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1f26349

Please sign in to comment.