Skip to content

Commit

Permalink
forgot to save
Browse files Browse the repository at this point in the history
  • Loading branch information
MINAJECHUNG committed Oct 5, 2024
1 parent d55736d commit ba925f2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/frc/robot/subsystems/drive/DriveIOSim.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package frc.robot.subsystems.drive;

import static edu.wpi.first.units.Units.MetersPerSecond;
import static edu.wpi.first.units.Units.Volts;

import edu.wpi.first.math.VecBuilder;
import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.math.controller.SimpleMotorFeedforward;
Expand Down Expand Up @@ -53,7 +56,6 @@ public DriveIOSim() {
m_leftLeader.addFollower(m_leftFollower);
m_rightLeader.addFollower(m_rightFollower);
}

@Override
public void updateInputs(DriveIOInputs inputs) {
// TODO: we will have encoders
Expand All @@ -73,10 +75,12 @@ public void arcadeDrive(double xSpeed, double omegaRotation) {
}

/** Sets speeds to the drivetrain motors. */
// TODO there is a unit's conflict here
//TODO there is a unit's conflict
private void setSpeeds(DifferentialDriveWheelSpeeds speeds) {
final double leftFeedforward = m_feedforward.calculate(speeds.leftMetersPerSecond);
final double rightFeedforward = m_feedforward.calculate(speeds.rightMetersPerSecond);
final double leftFeedforward =
m_feedforward.calculate(MetersPerSecond.of(speeds.leftMetersPerSecond)).in(Volts);
final double rightFeedforward =
m_feedforward.calculate(MetersPerSecond.of(speeds.rightMetersPerSecond)).in(Volts);
double leftOutput =
m_leftPIDController.calculate(m_leftEncoder.getRate(), speeds.leftMetersPerSecond);
double rightOutput =
Expand Down

0 comments on commit ba925f2

Please sign in to comment.