Skip to content

Commit 17109b2

Browse files
committed
mic algae command
1 parent dfc8974 commit 17109b2

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package frc.robot.commands.robotState;
2+
3+
import edu.wpi.first.wpilibj2.command.Command;
4+
import frc.robot.subsystems.algae.AlgaeSubsystem;
5+
import frc.robot.subsystems.biscuit.BiscuitSubsystem;
6+
import frc.robot.subsystems.elevator.ElevatorSubsystem;
7+
import frc.robot.subsystems.robotState.RobotStateSubsystem;
8+
import frc.robot.subsystems.robotState.RobotStateSubsystem.AlgaeHeight;
9+
import frc.robot.subsystems.robotState.RobotStateSubsystem.RobotStates;
10+
11+
public class MicAlgaeCommand extends Command {
12+
private RobotStateSubsystem robotState;
13+
private boolean hasTriedToPickup = false;
14+
15+
public MicAlgaeCommand(
16+
RobotStateSubsystem robotState,
17+
ElevatorSubsystem elevatorSubsystem,
18+
BiscuitSubsystem biscuitSubsystem,
19+
AlgaeSubsystem algaeSubsystem) {
20+
this.robotState = robotState;
21+
addRequirements(elevatorSubsystem, biscuitSubsystem, algaeSubsystem);
22+
}
23+
24+
@Override
25+
public void initialize() {
26+
hasTriedToPickup = false;
27+
robotState.setAlgaeHeight(AlgaeHeight.HIGH);
28+
robotState.toAlgaeFloorPickup();
29+
}
30+
31+
@Override
32+
public boolean isFinished() {
33+
if (robotState.getState() == RobotStates.MIC_ALGAE) {
34+
hasTriedToPickup = true;
35+
}
36+
return robotState.getState() == RobotStates.STOW && hasTriedToPickup;
37+
}
38+
}

0 commit comments

Comments
 (0)