Skip to content

Commit bfcdee2

Browse files
committed
change the name of Constants, and chang the command MoveUntil
1 parent db7bfba commit bfcdee2

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/main/java/frc/robot/Constants.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ public static class ShooterArmConstants {
230230
public static final double backwordLimit = 300;
231231

232232
// ArmPoseReset Constant
233-
public static final double poseReset = 0.0;
234-
235-
public static final double ArmStaticMovmentSpeed = -1;
233+
public static final double resetPose = 0.0;
234+
public static final double resetSpeed = -1;
236235
}
237236
}

src/main/java/frc/robot/commands/ShooterArmCommands/MoveShooterArmUntil.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
package frc.robot.commands.ShooterArmCommands;
66

77
import edu.wpi.first.wpilibj2.command.Command;
8+
import frc.robot.Constants;
89
import frc.robot.subsystems.ShooterArmSubsystem;
910

11+
import static frc.robot.Constants.ShooterArmConstants.*;
12+
13+
1014
public class MoveShooterArmUntil extends Command {
1115
/** Creates a new ResetShooterArmPos. */
1216
private final ShooterArmSubsystem shooterArmSubsystem = ShooterArmSubsystem.getInstance();
@@ -18,14 +22,14 @@ public MoveShooterArmUntil() {
1822
// Called when the command is initially scheduled.
1923
@Override
2024
public void initialize() {
21-
shooterArmSubsystem.moveArmByVoltage();
25+
shooterArmSubsystem.movementArmToReset();
2226
}
2327

2428

2529
// Called once the command ends or is interrupted.
2630
@Override
2731
public void end(boolean interrupted) {
28-
shooterArmSubsystem.setPosition(0);
32+
shooterArmSubsystem.setPosition(resetPose);
2933
}
3034

3135
// Returns true when the command should end.

src/main/java/frc/robot/subsystems/ShooterArmSubsystem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ public boolean getSwitch(){
101101
return this.limitSwitch.get();
102102
}
103103

104-
public void moveArmByVoltage(){
105-
m_ArmMotor.setVoltage(ArmStaticMovmentSpeed);
104+
public void movementArmToReset(){
105+
m_ArmMotor.set(resetSpeed);
106106
}
107107

108108

0 commit comments

Comments
 (0)