Skip to content

Commit

Permalink
Fixed offset for new encoder shaft
Browse files Browse the repository at this point in the history
  • Loading branch information
ky28059 committed Dec 16, 2022
1 parent 4afdf88 commit 0e22f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ public static final class SwerveConstants {

public static final int brDrive = 1;
public static final int brSteer = 12;
public static final double brOffsetRads = 5.09281621578;
public static final double brOffsetRads = 3.135456730438264;
public static final Translation2d brPos = new Translation2d(
Units.inchesToMeters(-13.1365),
Units.inchesToMeters(-10.3865)
);
}

public static final class IntakeConstants {
public static final int intakeTalonID = 6;
public static final int intakeSolID = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.kauailabs.navx.frc.AHRS;

import edu.wpi.first.math.MatBuilder;
import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.Nat;
import edu.wpi.first.math.estimator.SwerveDrivePoseEstimator;
import edu.wpi.first.math.geometry.Pose2d;
Expand Down Expand Up @@ -123,6 +124,8 @@ public void periodic() {
bottomRightModule.getState()
);

System.out.println(MathUtil.angleModulus(bottomRightModule.getState().angle.getRadians()));

// If all commanded velocities are 0, the system is idle (drivers are not supplying input).
boolean isIdle = states[0].speedMetersPerSecond == 0.0
&& states[1].speedMetersPerSecond == 0.0
Expand Down

0 comments on commit 0e22f3a

Please sign in to comment.