Skip to content

Commit

Permalink
Made code for offsetting all 4 modauls with one button, not working yet
Browse files Browse the repository at this point in the history
  • Loading branch information
2491NoMythic committed Feb 7, 2024
1 parent 25122f2 commit 4749c92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private void driveTrainInst() {
() -> modifyAxis(-driverController.getRawAxis(Y_AXIS), DEADBAND_NORMAL),
() -> modifyAxis(-driverController.getRawAxis(X_AXIS), DEADBAND_NORMAL),
() -> modifyAxis(-driverController.getRawAxis(Z_AXIS), DEADBAND_NORMAL));
driveTrain.setDefaultCommand(defaultDriveCommand);
driveTrain.setDefaultCommand(defaultDriveCommand);
}
private void shooterInst() {
shooter = new ShooterSubsystem(ShooterConstants.SHOOTER_MOTOR_POWER);
Expand Down Expand Up @@ -249,7 +249,7 @@ private void configureBindings() {
new Trigger(operatorController::getTriangleButton).onTrue(new InstantCommand(()-> climber.climberGo(ClimberConstants.CLIMBER_SPEED_UP))).onFalse(new InstantCommand(()-> climber.climberStop()));
new Trigger(operatorController::getSquareButton).onTrue(new ClimberPullDown(climber));
}
SmartDashboard.putData(new InstantCommand(driveTrain::setEncoderOffsets));
SmartDashboard.putData("set offsets", new InstantCommand(driveTrain::setEncoderOffsets));

// //Intake bindings
// new Trigger(operatorController::getL1Button).onTrue(new IntakeCommand(intake, iDirection.INTAKE));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/SwerveModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public double getTargetAngle() {
*/
public double findOffset() {
return MathUtil.inputModulus(
(m_steerEncoder.getPosition().getValue()-m_steerEncoderOffset.getRotations()),
(m_steerEncoder.getPosition().getValue()+m_steerEncoderOffset.getRotations()),
-0.5,
0.5);
}
Expand Down

0 comments on commit 4749c92

Please sign in to comment.