diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index 53d64a9..91c5d34 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -328,9 +328,8 @@ public final class Constants { } public static final class ElevatorConstants { - public static final class IDs { - public static final int ELEVATOR_ID = 420; - } + public static final CanDevice ELEVATOR_ID = new CanDevice("Elevator", 724); + public static final double LEVEL_1 = 123; public static final double LEVEL_2 = 123; public static final double ELEVATOR_MAX_HEIGHT = 123; @@ -338,6 +337,9 @@ public final class Constants { public static final double ELEVATOR_SPEED_DOWN = -123; - + public static final Slot0Configs ELEVATOR_PID = new Slot0Configs() + .withKP(0) + .withKI(0) + .withKD(0); } } diff --git a/src/main/java/frc4388/robot/RobotMap.java b/src/main/java/frc4388/robot/RobotMap.java index 5ae12c4..1a689a7 100644 --- a/src/main/java/frc4388/robot/RobotMap.java +++ b/src/main/java/frc4388/robot/RobotMap.java @@ -51,7 +51,7 @@ public class RobotMap { ); /* Elevator Subsystem */ - public final TalonFX elevator = new TalonFX(ElevatorConstants.IDs.ELEVATOR_ID); + public final TalonFX elevator = new TalonFX(ElevatorConstants.ELEVATOR_ID.id); void configureDriveMotorControllers() {} } diff --git a/src/main/java/frc4388/robot/subsystems/Elevator.java b/src/main/java/frc4388/robot/subsystems/Elevator.java index b69a720..ef24876 100644 --- a/src/main/java/frc4388/robot/subsystems/Elevator.java +++ b/src/main/java/frc4388/robot/subsystems/Elevator.java @@ -19,13 +19,10 @@ public class Elevator extends SubsystemBase { public Elevator(TalonFX elevatorTalonFX) { elevatorMotor = elevatorTalonFX; - elevatorMotor.setNeutralMode(NeutralModeValue.Coast); + elevatorMotor.setNeutralMode(NeutralModeValue.Brake); - var PIDConfigs = new Slot0Configs(); - PIDConfigs.kP = 0; - PIDConfigs.kI = 0; - PIDConfigs.kD = 0; - elevatorMotor.getConfigurator().apply(PIDConfigs); + + elevatorMotor.getConfigurator().apply(ElevatorConstants.ELEVATOR_PID); } //PID methods