Tentative fix for robot/runBlocking problem as per issue #2 added to competition code

This commit is contained in:
2024-11-13 09:15:08 -08:00
parent 3704c61dd4
commit e001588a46

View File

@ -107,6 +107,7 @@ public class CometBotTeleopCompetition {
public void toHighBucketScore() { public void toHighBucketScore() {
if (this.currentGP2.triangle && !this.previousGP2.triangle) { if (this.currentGP2.triangle && !this.previousGP2.triangle) {
if (this.arm.getState() == ArmActionsSubsystem.ArmState.PARK) { if (this.arm.getState() == ArmActionsSubsystem.ArmState.PARK) {
this.follower.breakFollowing();
fieldStates.setFieldLocation(FieldStates.FieldLocation.BUCKET); fieldStates.setFieldLocation(FieldStates.FieldLocation.BUCKET);
Actions.runBlocking(new SequentialAction( Actions.runBlocking(new SequentialAction(
this.lift.toHighBucketPosition(), this.lift.toHighBucketPosition(),
@ -123,6 +124,7 @@ public class CometBotTeleopCompetition {
this.lift.toFloorPosition() this.lift.toFloorPosition()
)); ));
fieldStates.setFieldLocation(FieldStates.FieldLocation.TRAVELING); fieldStates.setFieldLocation(FieldStates.FieldLocation.TRAVELING);
this.follower.startTeleopDrive();
} }
} }
} }
@ -140,6 +142,7 @@ public class CometBotTeleopCompetition {
public void toLowBucketScore() { public void toLowBucketScore() {
if (this.currentGP2.circle && !this.previousGP2.circle) { if (this.currentGP2.circle && !this.previousGP2.circle) {
if (this.arm.getState() == ArmActionsSubsystem.ArmState.PARK) { if (this.arm.getState() == ArmActionsSubsystem.ArmState.PARK) {
this.follower.breakFollowing();
fieldStates.setFieldLocation(FieldStates.FieldLocation.BUCKET); fieldStates.setFieldLocation(FieldStates.FieldLocation.BUCKET);
Actions.runBlocking(new SequentialAction( Actions.runBlocking(new SequentialAction(
this.lift.toLowBucketPosition(), this.lift.toLowBucketPosition(),
@ -156,6 +159,7 @@ public class CometBotTeleopCompetition {
this.lift.toFloorPosition() this.lift.toFloorPosition()
)); ));
fieldStates.setFieldLocation(FieldStates.FieldLocation.TRAVELING); fieldStates.setFieldLocation(FieldStates.FieldLocation.TRAVELING);
this.follower.startTeleopDrive();
} }
} }
} }