Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.

Commit 3e832e6

Browse files
authored
rename motors and sensors (#35)
1 parent e5085c2 commit 3e832e6

File tree

4 files changed

+24
-29
lines changed

4 files changed

+24
-29
lines changed

src/main/java/frc/robot/RobotMap.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public static class mapControllers {
1313
}
1414

1515
public static class mapHopper {
16-
public static final int HOPPER_MOTOR = 30;
17-
public static final int GAME_PIECE_HOPPER_DIO = 1;
18-
public static final int FULL_HOPPER_DIO = 2;
16+
public static final int ORIENTATION_MOTOR = 30;
17+
public static final int IS_GP_DETECTED_DIO = 1;
18+
public static final int IS_HOPPER_FULL_DIO = 2;
1919
}
2020

2121
public static class mapDriveTrain {
@@ -36,8 +36,8 @@ public static class mapShooter {
3636
}
3737

3838
public static class mapStager {
39-
public static final int CONVEYOR_MOTOR_CAN = 40;
40-
public static final int IS_GP_STAGED_DIO = 0;
39+
public static final int STAGER_MOTOR_CAN = 40;
40+
public static final int HAS_GP_DIO = 0;
4141
}
4242

4343
}

src/main/java/frc/robot/commands/StageGP.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void initialize() {
2525
// Called every time the scheduler runs while the command is scheduled.
2626
@Override
2727
public void execute() {
28-
if (globalStager.getIsGPStaged()) {
28+
if (globalStager.getHasGP()) {
2929
globalStager.setConveyorMotorVelocity(0);
3030
} else {
3131
globalStager.setConveyorMotorVelocity(0.3);

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,35 @@
1212

1313
public class Hopper extends SubsystemBase {
1414
/** Creates a new Hopper. */
15-
TalonFX HopperMotor;
16-
DigitalInput HopperSensor;
17-
18-
DigitalInput FullHopperSensor;
19-
15+
TalonFX orientationMotor;
16+
DigitalInput isGPDetected;
17+
DigitalInput isHopperFull;
2018

2119
public Hopper() {
22-
HopperMotor = new TalonFX(RobotMap.mapHopper.HOPPER_MOTOR);
23-
HopperSensor = new DigitalInput(RobotMap.mapHopper.GAME_PIECE_HOPPER_DIO);
24-
25-
FullHopperSensor = new DigitalInput(RobotMap.mapHopper.FULL_HOPPER_DIO);
20+
orientationMotor = new TalonFX(RobotMap.mapHopper.ORIENTATION_MOTOR);
21+
isGPDetected = new DigitalInput(RobotMap.mapHopper.IS_GP_DETECTED_DIO);
22+
isHopperFull = new DigitalInput(RobotMap.mapHopper.IS_HOPPER_FULL_DIO);
2623

2724
}
2825

2926
public void setHopperMotorSpeed(double speed) {
30-
HopperMotor.set(speed);
27+
orientationMotor.set(speed);
3128
}
3229

3330
public void setHopperMotorNuetralOutput() {
34-
HopperMotor.set(0);
31+
orientationMotor.set(0);
3532
}
3633

37-
3834
public boolean getGamePieceHopper() {
3935

40-
return HopperSensor.get();
36+
return isGPDetected.get();
4137
}
4238

4339
public boolean isHopperFull() {
4440

45-
return FullHopperSensor.get();
41+
return isHopperFull.get();
4642
}
4743

48-
4944
@Override
5045
public void periodic() {
5146

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212

1313
public class Stager extends SubsystemBase {
1414
/** Creates a new Stager. */
15-
TalonFX conveyorMotor;
16-
DigitalInput isGPStaged;
15+
TalonFX stagerMotor;
16+
DigitalInput hasGP;
1717

1818
public Stager() {
19-
conveyorMotor = new TalonFX(RobotMap.mapStager.CONVEYOR_MOTOR_CAN);
20-
isGPStaged = new DigitalInput(RobotMap.mapStager.IS_GP_STAGED_DIO);
19+
stagerMotor = new TalonFX(RobotMap.mapStager.STAGER_MOTOR_CAN);
20+
hasGP = new DigitalInput(RobotMap.mapStager.HAS_GP_DIO);
2121
}
2222

2323
public void setConveyorMotorVelocity(double velocity) {
24-
conveyorMotor.set(velocity);
24+
stagerMotor.set(velocity);
2525
}
2626

2727
public void setConveyorMotorVelocityNuetralOutput() {
28-
conveyorMotor.set(0);
28+
stagerMotor.set(0);
2929
}
3030

31-
public boolean getIsGPStaged() {
32-
return isGPStaged.get();
31+
public boolean getHasGP() {
32+
return hasGP.get();
3333
}
3434

3535
@Override

0 commit comments

Comments
 (0)