Skip to content
This repository was archived by the owner on Sep 12, 2023. It is now read-only.

Commit 673a07b

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents e1259aa + 32a9ef5 commit 673a07b

18 files changed

+350
-26
lines changed

TechnoTwoCode/src/main/java/org/firstinspires/ftc/teamcode/Controls.java

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
package org.firstinspires.ftc.teamcode;
22

3+
import static org.firstinspires.ftc.teamcode.Robot.RobotConstants.BUCKET_CONNECTED;
34
import static org.firstinspires.ftc.teamcode.Robot.RobotConstants.CAP_CONNECTED;
45
import static org.firstinspires.ftc.teamcode.Robot.RobotConstants.CAROUSEL_CONNECTED;
56
import static org.firstinspires.ftc.teamcode.Robot.RobotConstants.DEPOSIT_CONNECTED;
67
import static org.firstinspires.ftc.teamcode.Robot.RobotConstants.DRIVE_CONNECTED;
78
import static org.firstinspires.ftc.teamcode.Robot.RobotConstants.INTAKE_CONNECTED;
8-
import static org.firstinspires.ftc.teamcode.Robot.RobotConstants.LIFT_CONNECTED;
99

1010
import com.technototes.library.command.WaitCommand;
1111
import com.technototes.library.control.gamepad.CommandAxis;
1212
import com.technototes.library.control.gamepad.CommandButton;
1313
import com.technototes.library.control.gamepad.CommandGamepad;
1414
import com.technototes.library.control.gamepad.Stick;
1515

16-
import org.firstinspires.ftc.teamcode.commands.arm.ArmCollectCommand;
17-
import org.firstinspires.ftc.teamcode.commands.arm.ArmLevel1Command;
18-
import org.firstinspires.ftc.teamcode.commands.arm.ArmLevel3Command;
16+
import org.firstinspires.ftc.teamcode.commands.bucket.BucketCollectedCommand;
17+
import org.firstinspires.ftc.teamcode.commands.bucket.BucketCollectingCommand;
18+
import org.firstinspires.ftc.teamcode.commands.bucket.BucketUnloadLevel1Command;
19+
import org.firstinspires.ftc.teamcode.commands.bucket.BucketUnloadLevel2Command;
20+
import org.firstinspires.ftc.teamcode.commands.bucket.BucketUnloadLevel3Command;
1921
import org.firstinspires.ftc.teamcode.commands.carousel.CarouselLeftCommand;
2022
import org.firstinspires.ftc.teamcode.commands.carousel.CarouselRightCommand;
2123
import org.firstinspires.ftc.teamcode.commands.deposit.DumpVariableCommand;
@@ -70,12 +72,13 @@ public Controls(CommandGamepad g, Robot r){
7072
driveLeftStick = gamepad.leftStick;
7173
driveRightStick = gamepad.rightStick;
7274

73-
if(LIFT_CONNECTED) bindArmControls();
75+
// if(LIFT_CONNECTED) bindArmControls();
7476
if(DEPOSIT_CONNECTED) bindDepositControls();
7577
if(DRIVE_CONNECTED) bindDriveControls();
7678
if(INTAKE_CONNECTED) bindIntakeControls();
7779
if(CAROUSEL_CONNECTED) bindCarouselControls();
7880
if(CAP_CONNECTED) bindCapControls();
81+
if(BUCKET_CONNECTED) bindBucketControls();
7982
}
8083

8184

@@ -88,10 +91,19 @@ public void bindDepositControls(){
8891
// slideAdjustInButton.whilePressed(new ArmTranslateCommand(robot.depositSubsystem, 0.01));
8992
}
9093

91-
public void bindArmControls(){
92-
neutralHubButton.whenPressed(new ArmLevel1Command(robot.armSubsystem));
93-
specificHubButton.whenPressed(new ArmLevel3Command(robot.armSubsystem));
94-
toIntakeButton.whenPressed(new ArmCollectCommand(robot.armSubsystem));
94+
// public void bindArmControls(){
95+
// neutralHubButton.whenPressed(new ArmLevel1Command(robot.armSubsystem));
96+
// specificHubButton.whenPressed(new ArmLevel3Command(robot.armSubsystem));
97+
// toIntakeButton.whenPressed(new ArmCollectCommand(robot.armSubsystem));
98+
// }
99+
100+
public void bindBucketControls(){
101+
neutralHubButton.whenPressed(new BucketUnloadLevel1Command(robot.bucketSubsystem));
102+
specificHubButton.whenPressed(new BucketUnloadLevel3Command(robot.bucketSubsystem));
103+
toIntakeButton.whenPressed(new BucketCollectedCommand(robot.bucketSubsystem)
104+
.andThen(new BucketCollectingCommand(robot.bucketSubsystem))
105+
.andThen(new BucketCollectedCommand(robot.bucketSubsystem))
106+
);
95107
}
96108

97109
public void bindDriveControls(){
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import org.firstinspires.ftc.teamcode.subsystems.DepositSubsystem;
1212
import org.firstinspires.ftc.teamcode.subsystems.DrivebaseSubsystem;
1313

14-
public class AutonomousDuckCommand extends SequentialCommandGroup {
15-
public AutonomousDuckCommand(DrivebaseSubsystem drive, CarouselSubsystem carousel){
14+
public class AutonomousDuckCommandGroup extends SequentialCommandGroup {
15+
public AutonomousDuckCommandGroup(DrivebaseSubsystem drive, CarouselSubsystem carousel){
1616
super(new TrajectorySequenceCommand(drive, AutonomousConstants.DUCK_START_TO_CAROUSEL),
1717
new CarouselSpinCommand(carousel).withTimeout(3),
1818
new TrajectorySequenceCommand(drive, AutonomousConstants.DUCK_CAROUSEL_TO_PARK),
19-
CommandScheduler.getInstance()::terminateOpMode);
19+
CommandScheduler.getInstance()::terminateOpMode); //ending
2020
}
2121
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.firstinspires.ftc.teamcode.commands.autonomous;
2+
3+
import com.technototes.library.command.SequentialCommandGroup;
4+
import com.technototes.path.command.TrajectorySequenceCommand;
5+
6+
import org.firstinspires.ftc.teamcode.subsystems.BucketSubsystem;
7+
import org.firstinspires.ftc.teamcode.subsystems.DrivebaseSubsystem;
8+
9+
public class AutonomousLoopCommandGroup extends SequentialCommandGroup {
10+
public AutonomousLoopCommandGroup(DrivebaseSubsystem drivebaseSystem, BucketSubsystem bucketSystem){
11+
// new TrajectorySequenceCommand(); //from shelf to depot
12+
new DepotLoadingBlockCommand();
13+
// new TrajectorySequenceCommand(); //from depot to shelf
14+
new ShelfUnloadingLevel3Command();
15+
}
16+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* equivalent to AutonomousCycleCommand.java in TechnoOne
3+
*/
4+
package org.firstinspires.ftc.teamcode.commands.autonomous;
5+
6+
import com.technototes.library.command.CommandScheduler;
7+
import com.technototes.library.command.SequentialCommandGroup;
8+
import com.technototes.path.command.TrajectorySequenceCommand;
9+
10+
import org.firstinspires.ftc.teamcode.subsystems.BucketSubsystem;
11+
import org.firstinspires.ftc.teamcode.subsystems.CarouselSubsystem;
12+
import org.firstinspires.ftc.teamcode.subsystems.DrivebaseSubsystem;
13+
14+
public class AutonomousPhaseCommand extends SequentialCommandGroup {
15+
public AutonomousPhaseCommand(DrivebaseSubsystem drivebaseSystem, CarouselSubsystem carouselSystem, BucketSubsystem bucketSystem){
16+
super(new AutonomousDuckCommandGroup(drivebaseSystem, carouselSystem), //goto carousel and spin it
17+
// new TrajectorySequenceCommand(), //duck goto shipping hub
18+
new ShelfUnloadingLevel3Command(), //unload the preloaded cube
19+
new AutonomousLoopCommandGroup(drivebaseSystem, bucketSystem), //assuming running for three loops
20+
new AutonomousLoopCommandGroup(drivebaseSystem, bucketSystem),
21+
new AutonomousLoopCommandGroup(drivebaseSystem, bucketSystem),
22+
// new TrajectorySequenceCommand(), //goto parking
23+
CommandScheduler.getInstance()::terminateOpMode); //ending
24+
}
25+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.firstinspires.ftc.teamcode.commands.autonomous;
2+
3+
import com.technototes.library.command.Command;
4+
5+
public class DepotLoadingBlockCommand implements Command {
6+
@Override
7+
public void init() {
8+
9+
}
10+
11+
@Override
12+
public void execute() {
13+
14+
}
15+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.firstinspires.ftc.teamcode.commands.autonomous;
2+
3+
import com.technototes.library.command.Command;
4+
import com.technototes.library.subsystem.Subsystem;
5+
6+
public class ShelfUnloadingLevel1Command implements Command {
7+
8+
@Override
9+
public void init() {
10+
11+
}
12+
13+
@Override
14+
public void execute() {
15+
16+
}
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.firstinspires.ftc.teamcode.commands.autonomous;
2+
3+
import com.technototes.library.command.Command;
4+
5+
public class ShelfUnloadingLevel2Command implements Command {
6+
@Override
7+
public void init() {
8+
9+
}
10+
11+
@Override
12+
public void execute() {
13+
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.firstinspires.ftc.teamcode.commands.autonomous;
2+
3+
import com.technototes.library.command.Command;
4+
5+
public class ShelfUnloadingLevel3Command implements Command {
6+
@Override
7+
public void init() {
8+
9+
}
10+
11+
@Override
12+
public void execute() {
13+
14+
}
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.firstinspires.ftc.teamcode.commands.bucket;
2+
3+
import org.firstinspires.ftc.teamcode.subsystems.BucketSubsystem;
4+
import static org.firstinspires.ftc.teamcode.subsystems.BucketSubsystem.BucketConstant.COMBINATION_COLLECTED;
5+
6+
public class BucketCollectedCommand extends BucketCommand{
7+
public BucketCollectedCommand(BucketSubsystem bs) {
8+
super(bs, COMBINATION_COLLECTED);
9+
}
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.firstinspires.ftc.teamcode.commands.bucket;
2+
3+
import org.firstinspires.ftc.teamcode.subsystems.BucketSubsystem;
4+
import static org.firstinspires.ftc.teamcode.subsystems.BucketSubsystem.BucketConstant.COMBINATION_COLLECTING;
5+
6+
public class BucketCollectingCommand extends BucketCommand{
7+
public BucketCollectingCommand(BucketSubsystem bs) {
8+
super(bs, COMBINATION_COLLECTING);
9+
}
10+
}

0 commit comments

Comments
 (0)