Feature where driver can override centricity (robot vs field).
This commit is contained in:
@ -34,7 +34,9 @@ public class CometBotAutoDevelopment {
|
|||||||
public Gamepad currentGP2;
|
public Gamepad currentGP2;
|
||||||
public Gamepad previousGP2;
|
public Gamepad previousGP2;
|
||||||
private Telemetry telemetry;
|
private Telemetry telemetry;
|
||||||
|
|
||||||
public FieldStates fieldStates;
|
public FieldStates fieldStates;
|
||||||
|
private boolean centricity = false;
|
||||||
|
|
||||||
private Follower follower;
|
private Follower follower;
|
||||||
private HardwareMap hardwareMap;
|
private HardwareMap hardwareMap;
|
||||||
@ -99,12 +101,21 @@ public class CometBotAutoDevelopment {
|
|||||||
|
|
||||||
this.toFixMotorBlockingIssueFirstMethod();
|
this.toFixMotorBlockingIssueFirstMethod();
|
||||||
this.toFixMotorBlockingIssueSecondMethod();
|
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();
|
follower.update();
|
||||||
this.telemetry.addData("Field State", this.fieldStates.getFieldLocation());
|
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() {
|
public void toFixMotorBlockingIssueFirstMethod() {
|
||||||
if (this.currentGP1.cross && !this.previousGP1.cross) {
|
if (this.currentGP1.cross && !this.previousGP1.cross) {
|
||||||
fieldStates.setFieldLocation(FieldStates.FieldLocation.BUCKET);
|
fieldStates.setFieldLocation(FieldStates.FieldLocation.BUCKET);
|
||||||
|
Reference in New Issue
Block a user