Skip to content

Commit 06e70ad

Browse files
authored
Merge pull request #229 from strykeforce/mwitcpalek/teleopFixes
Mwitcpalek/teleop fixes
2 parents e869a6c + fcd6201 commit 06e70ad

File tree

7 files changed

+59
-6
lines changed

7 files changed

+59
-6
lines changed

src/main/java/frc/team2767/deepspace/command/approach/sequences/AutoHatchPickupCommandGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public AutoHatchPickupCommandGroup() {
3232

3333
addSequential(new PressureSetCommand(VacuumSubsystem.kHatchPressureInHg), 0.02);
3434
addSequential(new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP));
35-
addParallel(new ReleaseKrakenCommand(true));
35+
addParallel(new ReleaseKrakenCommand(false)); // Don't want kraken in teleop
3636
addParallel(new BiscuitPositionAboveCameraCommand());
3737
addParallel(new ElevatorExecutePlanCommand());
3838
addSequential(new VisionAutoAlignPickupCommand());

src/main/java/frc/team2767/deepspace/command/intake/WaitForBeamBreakCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ protected void execute() {
2020
if (INTAKE.isBeamBroken() && !hasBroken) {
2121
hasBroken = true;
2222
breakTime = System.currentTimeMillis();
23+
INTAKE.setPosition(105);
2324
}
2425
}
2526

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package frc.team2767.deepspace.command.sequences.pickup;
2+
3+
import edu.wpi.first.wpilibj.command.CommandGroup;
4+
import edu.wpi.first.wpilibj.command.ConditionalCommand;
5+
import frc.team2767.deepspace.Robot;
6+
import frc.team2767.deepspace.command.biscuit.BiscuitExecutePlanCommand;
7+
import frc.team2767.deepspace.command.elevator.ElevatorExecutePlanCommand;
8+
import frc.team2767.deepspace.command.elevator.ElevatorSetPositionCommand;
9+
import frc.team2767.deepspace.subsystem.BiscuitSubsystem;
10+
import frc.team2767.deepspace.subsystem.FieldDirection;
11+
import frc.team2767.deepspace.subsystem.VisionSubsystem;
12+
13+
public class Biscuit270WrapConditionalCommand extends ConditionalCommand {
14+
private static final BiscuitSubsystem BISCUIT = Robot.BISCUIT;
15+
private static final VisionSubsystem VISION = Robot.VISION;
16+
17+
private static double currentBiscuitPos;
18+
private static final double LEFT_270 = 260;
19+
private static final double RIGHT_270 = -260;
20+
21+
public Biscuit270WrapConditionalCommand() {
22+
super(
23+
new CommandGroup() {
24+
{
25+
addSequential(
26+
new CommandGroup() {
27+
{
28+
addParallel(new ElevatorSetPositionCommand(22.0));
29+
addParallel(new BiscuitExecutePlanCommand());
30+
}
31+
});
32+
33+
addSequential(new ElevatorExecutePlanCommand());
34+
}
35+
});
36+
}
37+
38+
// If Biscuit is wrapped 270 and needs to switch sides, move elevator up, spin biscuit, and move
39+
// back down
40+
@Override
41+
protected boolean condition() {
42+
currentBiscuitPos = BISCUIT.getPosition();
43+
return (currentBiscuitPos > LEFT_270 && VISION.direction == FieldDirection.RIGHT)
44+
|| (currentBiscuitPos < RIGHT_270 && VISION.direction == FieldDirection.LEFT);
45+
}
46+
}

src/main/java/frc/team2767/deepspace/command/sequences/pickup/CoconutPickupAutoRetryCommand.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ protected void execute() {
7373
ELEVATOR.openLoopMove(DOWN_SPEED);
7474
state = PickupState.DOWN;
7575
logger.info("Moving Down");
76+
break;
77+
}
78+
if (currentPressure - initialPressure > PRESSURE_DIFFERENTIAL) {
79+
state = PickupState.DONE;
80+
logger.info("Got Seal on RESET");
81+
break;
7682
}
7783
}
7884
}

src/main/java/frc/team2767/deepspace/command/sequences/pickup/CoconutPickupCommandGroup.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import edu.wpi.first.wpilibj.command.CommandGroup;
44
import frc.team2767.deepspace.command.biscuit.BiscuitSetPositionCommand;
55
import frc.team2767.deepspace.command.elevator.ElevatorSetPositionCommand;
6-
import frc.team2767.deepspace.command.intake.IntakePositionCommand;
76
import frc.team2767.deepspace.command.intake.RollerStopCommand;
87
import frc.team2767.deepspace.command.log.LogCommand;
98
import frc.team2767.deepspace.command.states.SetActionCommand;
@@ -16,8 +15,7 @@ public class CoconutPickupCommandGroup extends CommandGroup {
1615

1716
public CoconutPickupCommandGroup() {
1817
addSequential(new LogCommand("BEGIN COCONUT PICKUP"));
19-
20-
addParallel(new IntakePositionCommand(IntakeSubsystem.kMiddlePositionDeg));
18+
// addParallel(new IntakePositionCommand(IntakeSubsystem.kMiddlePositionDeg));
2119
addSequential(
2220
new CommandGroup() {
2321
{
@@ -47,7 +45,7 @@ public CoconutPickupCommandGroup() {
4745
}
4846
});*/
4947

50-
addParallel(new IntakePositionCommand(105));
48+
// addParallel(new IntakePositionCommand(105));
5149
addSequential(new BiscuitSetPositionCommand(BiscuitSubsystem.kDownPosition));
5250
// addSequential(new ElevatorDownFastOpenLoopCommand());
5351
// addSequential(new WaitForPressureCommand());

src/main/java/frc/team2767/deepspace/command/sequences/place/PositionExecuteCommandGroup.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
import frc.team2767.deepspace.command.elevator.ElevatorMoveToSafePositionCommand;
77
import frc.team2767.deepspace.command.log.LogCommand;
88
import frc.team2767.deepspace.command.sequences.pickup.BallToHatchConditionalCommand;
9+
import frc.team2767.deepspace.command.sequences.pickup.Biscuit270WrapConditionalCommand;
910

1011
public class PositionExecuteCommandGroup extends CommandGroup {
1112

1213
public PositionExecuteCommandGroup() {
1314
addSequential(new LogCommand("BEGIN POSITION EXECUTE"));
1415
addSequential(new ElevatorMoveToSafePositionCommand());
1516
addSequential(new BiscuitMoveSafeCommand());
17+
addSequential(new Biscuit270WrapConditionalCommand());
1618
addSequential(
1719
new CommandGroup() {
1820
{

src/main/java/frc/team2767/deepspace/command/teleop/StowElevatorConditionalCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public StowElevatorConditionalCommand() {
1515
super(
1616
new CommandGroup() {
1717
{
18-
addSequential(new ElevatorSetPositionCommand(23.0));
18+
addSequential(new ElevatorSetPositionCommand(25.0));
1919
addSequential(new BiscuitSetPositionCommand(BiscuitSubsystem.kUpPositionDeg));
2020
addSequential(new ElevatorSetPositionCommand(12.0));
2121
}

0 commit comments

Comments
 (0)