Feature where driver can override centricity (robot vs field).

This commit is contained in:
2024-11-13 15:09:59 -08:00
parent 94144780b8
commit dc71eb4317

View File

@ -34,7 +34,9 @@ public class CometBotAutoDevelopment {
public Gamepad currentGP2;
public Gamepad previousGP2;
private Telemetry telemetry;
public FieldStates fieldStates;
private boolean centricity = false;
private Follower follower;
private HardwareMap hardwareMap;
@ -99,12 +101,21 @@ public class CometBotAutoDevelopment {
this.toFixMotorBlockingIssueFirstMethod();
this.toFixMotorBlockingIssueSecondMethod();
this.changeCentricity();
follower.setTeleOpMovementVectors(-this.GP1.left_stick_y, -this.GP1.left_stick_x, -this.GP1.right_stick_x, false);
follower.setTeleOpMovementVectors(-this.GP1.left_stick_y, -this.GP1.left_stick_x, -this.GP1.right_stick_x, centricity);
follower.update();
this.telemetry.addData("Field State", this.fieldStates.getFieldLocation());
}
public void changeCentricity() {
if (this.currentGP1.left_bumper && !this.previousGP1.left_bumper) {
this.centricity = !centricity;
this.follower.breakFollowing();
this.follower.startTeleopDrive();
}
}
public void toFixMotorBlockingIssueFirstMethod() {
if (this.currentGP1.cross && !this.previousGP1.cross) {
fieldStates.setFieldLocation(FieldStates.FieldLocation.BUCKET);