Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into encoder-inversion
  • Loading branch information
carokhan committed Nov 28, 2024
2 parents 7cb0931 + c3dd943 commit dea4c40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ public static class Drive {
public static final int backRightEncoder = 3;

public static final double frontLeftOffset =
Rotation2d.fromDegrees(100.15).getRadians(); // 101.8585654710
Rotation2d.fromDegrees(-78.560751073938).getRadians(); // 101.8585654710
public static final double frontRightOffset =
Rotation2d.fromDegrees(39.11).getRadians(); // 39.585409
Rotation2d.fromDegrees(-175.70581168291014).getRadians(); // 39.585409
public static final double backLeftOffset =
Rotation2d.fromDegrees(100.15).getRadians(); // 103.4415122
Rotation2d.fromDegrees(-73.54207322946).getRadians(); // 103.4415122
public static final double backRightOffset =
Rotation2d.fromDegrees(110.45).getRadians(); // 110.898736
Rotation2d.fromDegrees(-72.38969990).getRadians(); // 110.898736

public static final int gyro = 10;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import frc.robot.Constants.RobotMap;
import java.util.OptionalDouble;
import java.util.Queue;
import org.littletonrobotics.junction.Logger;

/**
* Module IO implementation for SparkMax drive motor controller, SparkMax turn motor controller (NEO
Expand Down Expand Up @@ -160,6 +161,9 @@ public ModuleIOSparkMax(int index) {

@Override
public void updateInputs(ModuleIOInputs inputs) {
Logger.recordOutput(
"Module" + turnAbsoluteEncoder.getChannel() + "/AbsoluteEncoderVoltage",
turnAbsoluteEncoder.getVoltage());
inputs.drivePositionRad =
Units.rotationsToRadians(driveEncoder.getPosition()) / DriveConstants.driveRatio;
inputs.driveVelocityRadPerSec =
Expand Down

0 comments on commit dea4c40

Please sign in to comment.