Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
fix(intake): Configure rollers.
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenheroux committed Apr 8, 2024
1 parent 503f188 commit fbe8372
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/frc/robot/intake/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import frc.lib.Subsystem;
import frc.lib.Telemetry;
import frc.lib.controller.VelocityControllerIO;
import frc.lib.controller.VelocityControllerIO.VelocityControllerIOConstants;
import frc.lib.controller.VelocityControllerIO.VelocityControllerIOValues;
import frc.robot.intake.IntakeConstants.BackRollerConstants;
import frc.robot.intake.IntakeConstants.FrontRollerConstants;

/** Subsystem class for the intake subsystem. */
public class Intake extends Subsystem {
Expand All @@ -24,11 +25,11 @@ public class Intake extends Subsystem {
private Intake() {
frontRoller = IntakeFactory.createFrontRoller();
frontRollerValues = new VelocityControllerIOValues();
frontRoller.configure(new VelocityControllerIOConstants());
frontRoller.configure(FrontRollerConstants.CONTROLLER_CONSTANTS);

backRoller = IntakeFactory.createBackRoller();
backRollerValues = new VelocityControllerIOValues();
backRoller.configure(new VelocityControllerIOConstants());
backRoller.configure(BackRollerConstants.CONTROLLER_CONSTANTS);
}

/**
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/frc/robot/intake/IntakeConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import frc.lib.CAN;
import frc.lib.PIDFConstants;
import frc.lib.controller.VelocityControllerIO.VelocityControllerIOConstants;

/** Constants for the intake subsystem. */
public class IntakeConstants {
Expand All @@ -16,6 +17,14 @@ public static class FrontRollerConstants {
PIDF.kS = 0.13;
PIDF.kV = 0.1683;
}

/** Front roller's controller constants. */
public static final VelocityControllerIOConstants CONTROLLER_CONSTANTS = new VelocityControllerIOConstants();
static {
CONTROLLER_CONSTANTS.ccwPositive = false;
CONTROLLER_CONSTANTS.neutralBrake = true;
CONTROLLER_CONSTANTS.sensorToMechanismRatio = 24.0 / 16.0;
}
}

/** Constants for the back roller. */
Expand All @@ -29,6 +38,14 @@ public static class BackRollerConstants {
PIDF.kS = 0.13;
PIDF.kV = 0.1759;
}

/** Back roller's controller constants. */
public static final VelocityControllerIOConstants CONTROLLER_CONSTANTS = new VelocityControllerIOConstants();
static {
CONTROLLER_CONSTANTS.ccwPositive = false;
CONTROLLER_CONSTANTS.neutralBrake = true;
CONTROLLER_CONSTANTS.sensorToMechanismRatio = 24.0 / 16.0;
}
}

/** Constants for the roller motor. */
Expand Down

0 comments on commit fbe8372

Please sign in to comment.