This repository was archived by the owner on Sep 12, 2023. It is now read-only.
File tree 8 files changed +114
-8
lines changed
TechnoOneCode/src/main/java/org/firstinspires/ftc/teamcode/commands/deposit
TechnoTwoCode/src/main/java/org/firstinspires/ftc/teamcode/commands/deposit
8 files changed +114
-8
lines changed Original file line number Diff line number Diff line change 4
4
5
5
public class CarryCommand extends DumpVariableCommand {
6
6
public CarryCommand (DepositSubsystem s ){
7
+
7
8
super (s , DepositSubsystem .DepositConstants .CARRY );
8
9
}
9
10
@ Override
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ public DumpCommand(DepositSubsystem s){
10
10
}
11
11
@ Override
12
12
public boolean isFinished () {
13
- return getRuntime ().seconds ()> 0.5 ;
13
+ return getRuntime ().seconds () > 0.5 ;
14
14
}
15
15
}
Original file line number Diff line number Diff line change 1
1
package org .firstinspires .ftc .teamcode .commands .deposit ;
2
2
3
- public class ArmExtendCommand {
3
+ import com .technototes .library .command .Command ;
4
+
5
+ import org .firstinspires .ftc .teamcode .subsystems .DepositSubsystem ;
6
+
7
+ public class ArmExtendCommand implements Command {
8
+ public DepositSubsystem subsystem ;
9
+ public ArmExtendCommand (DepositSubsystem s ) {
10
+ subsystem = s ;
11
+ addRequirements (s );
12
+ }
13
+
14
+ @ Override
15
+ public void execute () {
16
+ subsystem .fullyOut ();
17
+ subsystem .collect ();
18
+ }
19
+
20
+ @ Override
21
+ public boolean isFinished () {
22
+ return getRuntime ().seconds () > 1 ;
23
+ }
4
24
}
Original file line number Diff line number Diff line change 1
1
package org .firstinspires .ftc .teamcode .commands .deposit ;
2
2
3
- public class ArmTranslateCommand {
3
+ import com .technototes .library .command .Command ;
4
+
5
+ import org .firstinspires .ftc .teamcode .subsystems .DepositSubsystem ;
6
+
7
+ public class ArmTranslateCommand implements Command {
8
+ public DepositSubsystem subsystem ;
9
+ public double amount ;
10
+ public ArmTranslateCommand (DepositSubsystem s , double amt ) {
11
+ subsystem = s ;
12
+ amount = amt ;
13
+ addRequirements (s );
14
+ }
15
+
16
+ @ Override
17
+ public void execute () {
18
+ subsystem .translateExtension (amount );
19
+ }
20
+
21
+ @ Override
22
+ public boolean isFinished () {
23
+ return getRuntime ().seconds () > 0.1 ;
24
+ }
4
25
}
Original file line number Diff line number Diff line change 1
1
package org .firstinspires .ftc .teamcode .commands .deposit ;
2
2
3
- public class CarryCommand {
3
+ import org .firstinspires .ftc .teamcode .subsystems .DepositSubsystem ;
4
+
5
+ public class CarryCommand extends DumpVariableCommand {
6
+ public CarryCommand (DepositSubsystem s ) {
7
+ super (s , DepositSubsystem .DepositConstants .CARRY ); // good
8
+
9
+ }
10
+
11
+ @ Override
12
+ public boolean isFinished () {
13
+ return true ;
14
+ }
4
15
}
16
+
Original file line number Diff line number Diff line change 1
1
package org .firstinspires .ftc .teamcode .commands .deposit ;
2
2
3
- public class CollectCommand {
3
+ import org .firstinspires .ftc .teamcode .subsystems .DepositSubsystem ;
4
+
5
+ public class CollectCommand extends DumpVariableCommand {
6
+ public CollectCommand (DepositSubsystem s ) {
7
+ super (s , DepositSubsystem .DepositConstants .COLLECT ); // yes very good
8
+ }
9
+
10
+ @ Override
11
+ public boolean isFinished () {
12
+ return true ; // ask alex about this
13
+ }
4
14
}
Original file line number Diff line number Diff line change 1
1
package org .firstinspires .ftc .teamcode .commands .deposit ;
2
2
3
- public class DumpCommand {
4
- }
3
+ import org .firstinspires .ftc .teamcode .subsystems .DepositSubsystem ;
4
+
5
+ public class DumpCommand extends DumpVariableCommand {
6
+ // no member variables because idk its already extending idk
7
+ public DumpCommand (DepositSubsystem s ) {
8
+ super (s , DepositSubsystem .DepositConstants .DUMP ); // yes work
9
+ }
10
+
11
+ @ Override
12
+ public boolean isFinished () {
13
+ return getRuntime ().seconds () > 0.5 ;
14
+ }
15
+ }
Original file line number Diff line number Diff line change 1
1
package org .firstinspires .ftc .teamcode .commands .deposit ;
2
2
3
- public class DumpVariableCommand {
3
+ import com .technototes .library .command .Command ;
4
+
5
+ import org .firstinspires .ftc .teamcode .subsystems .DepositSubsystem ;
6
+
7
+ import java .util .function .DoubleSupplier ;
8
+
9
+ public class DumpVariableCommand implements Command {
10
+ public DepositSubsystem subsystem ;
11
+ public DoubleSupplier supplier ;
12
+ public DumpVariableCommand (DepositSubsystem s , DoubleSupplier pos ) {
13
+ subsystem = s ;
14
+ supplier = pos ;
15
+ addRequirements (s );
16
+ }
17
+ public DumpVariableCommand (DepositSubsystem s , double pos ) {
18
+ this (s , ()->pos );
19
+ }
20
+ @ Override
21
+ public void execute () {
22
+ subsystem .setDump (supplier .getAsDouble ());
23
+ }
24
+
25
+ @ Override
26
+ public boolean isFinished () {
27
+ return false ;
28
+ }
29
+
30
+ @ Override
31
+ public void end (boolean cancel ) {
32
+ if (cancel )
33
+ subsystem .carry ();
34
+ }
4
35
}
You can’t perform that action at this time.
0 commit comments