mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-13 06:22:33 +00:00
Fixed Move unlikely to correctly handle backward destinations, add driver feedback for co-pilot toggle.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user