Fixed Move unlikely to correctly handle backward destinations, add driver feedback for co-pilot toggle.

This commit is contained in:
2023-01-29 19:51:59 -06:00
parent 513733965a
commit 236c291275
2 changed files with 8 additions and 2 deletions

View File

@@ -79,8 +79,8 @@ public class Move extends CyberarmState {
if (Math.abs(travelledDistance) < easeInDistance) {
ratio = travelledDistance / easeInDistance;
} else if (Math.abs(travelledDistance) > targetDistance - easeOutDistance) {
ratio = (targetDistance - Math.abs(travelledDistance)) / easeOutDistance;
} else if (Math.abs(travelledDistance) > Math.abs(targetDistance) - easeOutDistance) {
ratio = (Math.abs(targetDistance) - Math.abs(travelledDistance)) / easeOutDistance;
}
ratio = Range.clip(ratio, 0.0, 1.0);

View File

@@ -164,6 +164,12 @@ public class ArmDriverControl extends CyberarmState {
// Swap controlling gamepad
if (gamepad == engine.gamepad2 && button.equals("guide")) {
controller = controller == engine.gamepad1 ? engine.gamepad2 : engine.gamepad1;
if (controller == engine.gamepad1) {
engine.telemetry.speak("Pilot Only");
} else {
engine.telemetry.speak("Co-Pilot Enabled");
}
}
if (gamepad != controller) {