alert trafficSignChange when softhold.
This commit is contained in:
parent
ec11cf85cb
commit
6f91fb8a83
@ -360,6 +360,7 @@ class CarrotPlanner:
|
|||||||
self.xStop = self.update_stop_dist(x[31])
|
self.xStop = self.update_stop_dist(x[31])
|
||||||
stop_model_x = self.xStop
|
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, self.xStop, y)
|
||||||
self.check_model_stopping(v, v_ego, a_ego, x[-1], y, radarstate.leadOne.dRel if lead_detected else 1000)
|
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:
|
if self.soft_hold_active > 0:
|
||||||
self.xState = XState.e2eStopped
|
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:
|
elif self.xState == XState.e2eStopped:
|
||||||
if carstate.gasPressed:
|
if carstate.gasPressed:
|
||||||
self.xState = XState.e2ePrepare
|
self.xState = XState.e2ePrepare
|
||||||
|
Loading…
x
Reference in New Issue
Block a user