From 39611ad6dd04da5b1f559dca54b59e1af2388bdd Mon Sep 17 00:00:00 2001 From: James <91348155+FrogAi@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:00:00 -0700 Subject: [PATCH] Pause Acceleration/Braking --- frogpilot/controls/frogpilot_card.py | 4 ++++ frogpilot/ui/qt/onroad/frogpilot_annotated_camera.cc | 3 ++- frogpilot/ui/qt/onroad/frogpilot_annotated_camera.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frogpilot/controls/frogpilot_card.py b/frogpilot/controls/frogpilot_card.py index 91716cae7..b3cad5f7c 100644 --- a/frogpilot/controls/frogpilot_card.py +++ b/frogpilot/controls/frogpilot_card.py @@ -20,6 +20,7 @@ class FrogPilotCard: self.decel_pressed = False self.distancePressed_previously = False self.force_coast = False + self.pause_longitudinal = False self.gap_counter = 0 @@ -36,6 +37,8 @@ class FrogPilotCard: self.handle_experimental_mode(sm, frogpilot_toggles) elif sm["carControl"].longActive and getattr(frogpilot_toggles, f"force_coast_via_{key}"): self.force_coast = not self.force_coast + elif sm["carControl"].longActive and getattr(frogpilot_toggles, f"pause_longitudinal_via_{key}"): + self.pause_longitudinal = not self.pause_longitudinal def handle_experimental_mode(self, sm, frogpilot_toggles): if frogpilot_toggles.conditional_experimental_mode: @@ -100,5 +103,6 @@ class FrogPilotCard: frogpilotCarState.distanceLongPressed = self.very_long_press_threshold > self.gap_counter >= self.long_press_threshold frogpilotCarState.distanceVeryLongPressed = self.gap_counter >= self.very_long_press_threshold frogpilotCarState.forceCoast = self.force_coast + frogpilotCarState.pauseLongitudinal = self.pause_longitudinal return frogpilotCarState diff --git a/frogpilot/ui/qt/onroad/frogpilot_annotated_camera.cc b/frogpilot/ui/qt/onroad/frogpilot_annotated_camera.cc index d99f39aff..917fa298e 100644 --- a/frogpilot/ui/qt/onroad/frogpilot_annotated_camera.cc +++ b/frogpilot/ui/qt/onroad/frogpilot_annotated_camera.cc @@ -159,6 +159,7 @@ void FrogPilotAnnotatedCameraWidget::updateState(const UIState &s, const FrogPil forceCoast = frogpilotCarState.getForceCoast(); laneWidthLeft = frogpilotPlan.getLaneWidthLeft(); laneWidthRight = frogpilotPlan.getLaneWidthRight(); + longitudinalPaused = frogpilotCarState.getPauseLongitudinal(); redLight = frogpilotPlan.getRedLight(); roadCurvature = frogpilotPlan.getRoadCurvature(); roadName = QString::fromStdString(params_memory.get("RoadName")); @@ -230,7 +231,7 @@ void FrogPilotAnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &p, UIState } } - if (!hideBottomIcons && (forceCoast)) { + if (!hideBottomIcons && (forceCoast || longitudinalPaused)) { paintLongitudinalPaused(p); } diff --git a/frogpilot/ui/qt/onroad/frogpilot_annotated_camera.h b/frogpilot/ui/qt/onroad/frogpilot_annotated_camera.h index 115db0b68..ff4a849d1 100644 --- a/frogpilot/ui/qt/onroad/frogpilot_annotated_camera.h +++ b/frogpilot/ui/qt/onroad/frogpilot_annotated_camera.h @@ -79,6 +79,7 @@ private: bool cscTraining; bool experimentalMode; bool forceCoast; + bool longitudinalPaused; bool redLight; int animationFrameIndex;