mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-15 20:12:35 +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) {
|
if (Math.abs(travelledDistance) < easeInDistance) {
|
||||||
ratio = travelledDistance / easeInDistance;
|
ratio = travelledDistance / easeInDistance;
|
||||||
} else if (Math.abs(travelledDistance) > targetDistance - easeOutDistance) {
|
} else if (Math.abs(travelledDistance) > Math.abs(targetDistance) - easeOutDistance) {
|
||||||
ratio = (targetDistance - Math.abs(travelledDistance)) / easeOutDistance;
|
ratio = (Math.abs(targetDistance) - Math.abs(travelledDistance)) / easeOutDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
ratio = Range.clip(ratio, 0.0, 1.0);
|
ratio = Range.clip(ratio, 0.0, 1.0);
|
||||||
|
|||||||
@@ -164,6 +164,12 @@ public class ArmDriverControl extends CyberarmState {
|
|||||||
// Swap controlling gamepad
|
// Swap controlling gamepad
|
||||||
if (gamepad == engine.gamepad2 && button.equals("guide")) {
|
if (gamepad == engine.gamepad2 && button.equals("guide")) {
|
||||||
controller = controller == engine.gamepad1 ? engine.gamepad2 : engine.gamepad1;
|
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) {
|
if (gamepad != controller) {
|
||||||
|
|||||||
Reference in New Issue
Block a user