From 4a1028a1bf614d32860a94f4be25e8420ded8dcb Mon Sep 17 00:00:00 2001 From: rachitkakkar Date: Thu, 11 Jan 2024 09:50:08 -0600 Subject: [PATCH] Code cleanup --- src/main/java/frc/robot/Constants.java | 2 +- .../robot/subsystems/intake/IntakeSubsystem.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index ed0f6db..1154b04 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -113,7 +113,7 @@ public static class VisionHardware { } public static class IntakeHardware { - public static final Spark.ID ROLLER_MOTOR_ID = new Spark.ID("IntakeHardware/RollerMotor", 10); + public static final Spark.ID ROLLER_MOTOR_ID = new Spark.ID("IntakeHardware/Roller", 10); } public static class SmartDashboard { diff --git a/src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java index e9ff671..6b50f20 100644 --- a/src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java @@ -49,23 +49,23 @@ private void intake(double speed) { m_rollerMotor.set(speed, ControlType.kDutyCycle, 0.0, ArbFFUnits.kPercentOut); } - public Command intakeCommand(DoubleSupplier speed) { - return startEnd(() -> intake(speed.getAsDouble()), () -> stop()); - } - // Tells the robot to outtake private void outtake(double speed) { m_rollerMotor.set(-speed, ControlType.kDutyCycle, 0.0, ArbFFUnits.kPercentOut); } - public Command outtakeCommand(DoubleSupplier speed) { - return startEnd(() -> outtake(speed.getAsDouble()), () -> stop()); - } - // Stop the robot private void stop() { m_rollerMotor.stopMotor();; } + + public Command intakeCommand(DoubleSupplier speed) { + return startEnd(() -> intake(speed.getAsDouble()), () -> stop()); + } + + public Command outtakeCommand(DoubleSupplier speed) { + return startEnd(() -> outtake(speed.getAsDouble()), () -> stop()); + } @Override public void periodic() {