Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Format with Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahsnider committed Aug 30, 2024
1 parent 369a2b6 commit b13b9b3
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/main/java/frc/robot/arm/ArmSubsystem.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package frc.robot.arm;

import com.ctre.phoenix6.controls.PositionVoltage;
import com.ctre.phoenix6.controls.StaticBrake;
import com.ctre.phoenix6.hardware.TalonFX;
import dev.doglog.DogLog;
import edu.wpi.first.math.MathUtil;
Expand All @@ -24,12 +23,15 @@ public class ArmSubsystem extends StateMachine<ArmState> {
private InterpolatingDoubleTreeMap speakerDistanceToAngle = new InterpolatingDoubleTreeMap();
private InterpolatingDoubleTreeMap feedSpotDistanceToAngle = new InterpolatingDoubleTreeMap();
private final PositionVoltage positionRequest =
new PositionVoltage(0).withEnableFOC(false).withLimitReverseMotion(false).withOverrideBrakeDurNeutral(true);
new PositionVoltage(0)
.withEnableFOC(false)
.withLimitReverseMotion(false)
.withOverrideBrakeDurNeutral(true);

// private final StaticBrake staticBrake =
// new StaticBrake();
//IF withOverrideBrakeDurNeutral DOEST WORK


// IF withOverrideBrakeDurNeutral DOEST WORK

public void setDistanceToSpeaker(double distance) {
distanceToSpeaker = distance;
}
Expand All @@ -54,13 +56,14 @@ public void setState(ArmState newState) {
setStateFromRequest(newState);
}
}
// public void disabledPeriodic()
// {
// rightMotor.setControl(staticBrake);
// rightMotor.setControl(staticBrake);
// }
//IF withOverrideBrakeDurNeutral DOESNT WORK
public boolean atGoal() {

// public void disabledPeriodic()
// {
// rightMotor.setControl(staticBrake);
// rightMotor.setControl(staticBrake);
// }
// IF withOverrideBrakeDurNeutral DOESNT WORK
public boolean atGoal() {
return switch (getState()) {
case IDLE, PRE_MATCH_HOMING -> true;
case SPEAKER_SHOT ->
Expand All @@ -85,7 +88,7 @@ public boolean atGoal() {
case CLIMBING_2_HANGING ->
MathUtil.isNear(ArmAngle.CLIMBING_2_HANGING.getDegrees(), leftMotorAngle, 1)
&& MathUtil.isNear(ArmAngle.CLIMBING_2_HANGING.getDegrees(), rightMotorAngle, 1);

case AMP ->
MathUtil.isNear(ArmAngle.AMP.getDegrees(), leftMotorAngle, 1)
&& MathUtil.isNear(ArmAngle.AMP.getDegrees(), rightMotorAngle, 1);
Expand Down Expand Up @@ -122,7 +125,7 @@ protected void afterTransition(ArmState newState) {
rightMotor.setControl(
positionRequest.withPosition(ArmAngle.CLIMBING_2_HANGING.getRotations()));
}

case DROP -> {
leftMotor.setControl(positionRequest.withPosition(ArmAngle.DROP.getRotations()));
rightMotor.setControl(positionRequest.withPosition(ArmAngle.DROP.getRotations()));
Expand Down Expand Up @@ -154,7 +157,7 @@ protected void afterTransition(ArmState newState) {
}
}
}

@Override
public void robotPeriodic() {
super.robotPeriodic();
Expand Down Expand Up @@ -199,5 +202,4 @@ private static double clampAngle(double angle) {
}
return angle;
}

}

0 comments on commit b13b9b3

Please sign in to comment.