Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions src/main/java/frc/robot/commands/states/EjectingHopper.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,46 @@
package frc.robot.commands.states;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.RobotContainer;
import frc.robot.constants.ConstMotion;
import frc.robot.constants.ConstRotors;
import frc.robot.subsystems.StateMachine;
import frc.robot.*;

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class EjectingHopper extends Command {
public class EjectingHopper extends Command

{
/** Creates a new EjectingHopper. */
public EjectingHopper() {

addRequirements(RobotContainer.stateMachineInstance);

// Use addRequirements() here to declare subsystem dependencies.
}
Comment thread
TaylerUva marked this conversation as resolved.

// Called when the command is initially scheduled.
@Override
public void initialize() {}
public void initialize() {
RobotContainer.stateMachineInstance.setRobotState(StateMachine.RobotState.EJECTING_HOPPER);
RobotContainer.motionInstance.setIntakePivotAngle(ConstMotion.INTAKE_PIVOT_DEPLOY);
RobotContainer.rotorsInstance.setIntakeRollersPercentOutput(ConstRotors.REVERSE_SERIALIZER_ROLLERS_SPEED);
RobotContainer.rotorsInstance.setSerializerRollersPercentOutput(ConstRotors.REVERSE_TRANSFER_ROLLERS_SPEED);
RobotContainer.rotorsInstance.setTransferRollersPercentOutput(ConstRotors.REVERSE_INTAKE_ROLLERS_SPEED);
}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {}
public void execute() {
}
Comment thread
TaylerUva marked this conversation as resolved.
Comment thread
TaylerUva marked this conversation as resolved.

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {}
public void end(boolean interrupted) {
RobotContainer.rotorsInstance.setIntakeRollersPercentOutput(ConstRotors.STOP);
RobotContainer.rotorsInstance.setSerializerRollersPercentOutput(ConstRotors.STOP);
RobotContainer.rotorsInstance.setTransferRollersPercentOutput(ConstRotors.STOP);
}

// Returns true when the command should end.
@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/states/Intaking.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public Intaking() {
@Override
public void initialize() {
RobotContainer.motionInstance.setIntakePivotAngle(ConstMotion.INTAKE_PIVOT_DEPLOY);
RobotContainer.rotorsInstance.setIntakeRollersPercentOutput(ConstRotors.INTAKE_ROLLERS_SPEED);

}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
RobotContainer.rotorsInstance.setIntakeRollersPercentOutput(ConstRotors.INTAKE_ROLLERS_SPEED);

}

// Called once the command ends or is interrupted.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/constants/ConstRotors.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public class ConstRotors {
public static final double SERIALIZER_SHOOTING_SPEED = 0.5;
public static final double STOP = 0;
public static final double REVERSE_SHOOTING_SPEED = -1;
public static final double REVERSE_SERIALIZER_ROLLERS_SPEED = -0.5;
public static final double REVERSE_INTAKE_ROLLERS_SPEED = -0.5;
public static final double REVERSE_TRANSFER_ROLLERS_SPEED = -0.5;

static {

// SHOOTER_TRANSFER_EAST_CONFIGURATION.MotorOutput.NeutralMode =
Expand Down
Loading