From 6f91fb8a834a3f271d92d3ee526fd1d3882f6797 Mon Sep 17 00:00:00 2001 From: ajouatom Date: Sun, 9 Feb 2025 19:25:18 +0900 Subject: [PATCH] alert trafficSignChange when softhold. --- selfdrive/carrot/carrot_functions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selfdrive/carrot/carrot_functions.py b/selfdrive/carrot/carrot_functions.py index 1a1d247..b424d26 100644 --- a/selfdrive/carrot/carrot_functions.py +++ b/selfdrive/carrot/carrot_functions.py @@ -360,6 +360,7 @@ class CarrotPlanner: self.xStop = self.update_stop_dist(x[31]) stop_model_x = self.xStop + trafficState_last = self.trafficState #self.check_model_stopping(v, v_ego, self.xStop, y) self.check_model_stopping(v, v_ego, a_ego, x[-1], y, radarstate.leadOne.dRel if lead_detected else 1000) @@ -377,6 +378,8 @@ class CarrotPlanner: if self.soft_hold_active > 0: self.xState = XState.e2eStopped + if trafficState_last in [TrafficState.off, TrafficState.red] and self.trafficState == TrafficState.green: + self.events.add(EventName.trafficSignChanged) elif self.xState == XState.e2eStopped: if carstate.gasPressed: self.xState = XState.e2ePrepare