From c71a9aed6e86815daa07f3c5fc8e897d8eac0a01 Mon Sep 17 00:00:00 2001 From: whoisdomi Date: Wed, 6 May 2026 07:22:48 -0500 Subject: [PATCH] Force Stop bugfix: gap behind leads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Force Stop (cem_path) was missing a tracking_lead guard, causing it to activate behind stopped leads at red lights and stop signs — stopping the car far short of the lead instead of letting ACC handle following distance. Added and not self.starpilot_planner.tracking_lead to cem_path, matching the guard already present on dash_path. --- starpilot/controls/lib/starpilot_vcruise.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/starpilot/controls/lib/starpilot_vcruise.py b/starpilot/controls/lib/starpilot_vcruise.py index edddd99fd..15fbc3bb5 100644 --- a/starpilot/controls/lib/starpilot_vcruise.py +++ b/starpilot/controls/lib/starpilot_vcruise.py @@ -65,12 +65,16 @@ class StarPilotVCruise: long_control_active = sm["carControl"].longActive # ----- Activation paths ----- - # CEM/model path: model predicted stop within ACTIVATION_M + # CEM/model path: model predicted stop within ACTIVATION_M. + # Exclude when tracking a lead — the handoff_to_stopped_lead path in CEM can set + # stop_light_detected even with a lead present, which would incorrectly activate + # Force Stop and stop the car far behind the lead instead of letting ACC handle it. cem_path = (self.starpilot_planner.starpilot_cem.stop_light_detected and controls_enabled and starpilot_toggles.force_stops and self.starpilot_planner.model_length < ACTIVATION_M and self.override_force_stop_timer <= 0 - and not self.starpilot_planner.driving_in_curve) + and not self.starpilot_planner.driving_in_curve + and not self.starpilot_planner.tracking_lead) # Dashboard path: ADAS camera confirms a stop sign on our road. Field is 0 on # platforms that don't publish ADAS_0x380, so dash_path is naturally inert there.