Pause Acceleration/Braking

This commit is contained in:
James
2025-12-01 12:00:00 -07:00
parent ae081bfd56
commit 39611ad6dd
3 changed files with 7 additions and 1 deletions
+4
View File
@@ -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
@@ -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);
}
@@ -79,6 +79,7 @@ private:
bool cscTraining;
bool experimentalMode;
bool forceCoast;
bool longitudinalPaused;
bool redLight;
int animationFrameIndex;