Skip to content

Commit

Permalink
Intake edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan1522 committed Jan 17, 2025
1 parent 253fc4c commit 944411b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import edu.wpi.first.wpilibj2.command.button.Trigger;
import frc.robot.Constants.SimulationConstants;
import frc.robot.commands.drive.DriveCommand;
import frc.robot.commands.drive.Eject;
import frc.robot.commands.drive.Intake;
import frc.robot.commands.intake.Eject;
import frc.robot.commands.intake.Intake;
import frc.robot.extras.simulation.field.SimulatedField;
import frc.robot.extras.simulation.mechanismSim.IntakeSimulation.IntakeSide;
import frc.robot.extras.simulation.mechanismSim.swerve.GyroSimulation;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/commands/intake/Eject.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ public Eject(IntakeSubsystem intakeSubsystem){
addRequirements(this.intakeSubsystem);
}

@Override
public void execute(){
intakeSubsystem.setIntakeSpeed(IntakeConstants.ejectSpeed);
}

public void end(){
@Override
public void end(boolean interrupted){
intakeSubsystem.setIntakeSpeed(0);
}

@Override
public boolean isFinished(){
return false;
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/commands/intake/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ public Intake(IntakeSubsystem intakeSubsystem){
addRequirements(this.intakeSubsystem);
}

@Override
public void execute(){
intakeSubsystem.setIntakeSpeed(IntakeConstants.intakeSpeed);
}

public void end(){
@Override
public void end(boolean interrupted){
intakeSubsystem.setIntakeSpeed(0);
}

@Override
public boolean isFinished(){
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ public final class IntakeConstants {

public static final int intakeSpeed = 0 - 9;
public static final int ejectSpeed = 0 - 9;

//the max amount of stator and supply current allowed in the motor, respectively
public static final double IntakeStatorLimit = 0.0;
public static final double IntakeSupplyLimit = 0.0;
//Enables stator and supply current limits, respectively
public static final boolean IntakeStatorLimitEnable = true;
public static final boolean IntakeSupplyLimitEnable = true;
}
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/subsystems/intake/PhysicalIntake.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public PhysicalIntake(){
intakeConfig.MotorOutput.NeutralMode = NeutralModeValue.Brake;
intakeConfig.MotorOutput.DutyCycleNeutralDeadband = HardwareConstants.MIN_FALCON_DEADBAND;

intakeConfig.CurrentLimits.StatorCurrentLimit = 0.0;
intakeConfig.CurrentLimits.StatorCurrentLimitEnable = true;
intakeConfig.CurrentLimits.SupplyCurrentLimit = 0.0;
intakeConfig.CurrentLimits.StatorCurrentLimitEnable = true;
intakeConfig.CurrentLimits.StatorCurrentLimit = IntakeConstants.IntakeStatorLimit;
intakeConfig.CurrentLimits.StatorCurrentLimitEnable = IntakeConstants.IntakeStatorLimitEnable;
intakeConfig.CurrentLimits.SupplyCurrentLimit = IntakeConstants.IntakeSupplyLimit;
intakeConfig.CurrentLimits.StatorCurrentLimitEnable = IntakeConstants.IntakeSupplyLimitEnable;

motor.getConfigurator().apply(intakeConfig);
}
Expand Down

0 comments on commit 944411b

Please sign in to comment.