mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-22 00:23:43 +08:00
Only trigger model FCW on stock long when not already braking (#22620)
* Only trigger model FCW on stock long when not already braking
* Split model_fcw checks for better readability
old-commit-hash: 38f775edfc
This commit is contained in:
@@ -282,8 +282,10 @@ class Controls:
|
||||
for pandaState in self.sm['pandaStates']:
|
||||
if log.PandaState.FaultType.relayMalfunction in pandaState.faults:
|
||||
self.events.add(EventName.relayMalfunction)
|
||||
|
||||
stock_long_is_braking = self.enabled and not self.CP.openpilotLongitudinalControl and CS.aEgo < -1.5
|
||||
model_fcw = self.sm['modelV2'].meta.hardBrakePredicted and not CS.brakePressed and not stock_long_is_braking
|
||||
planner_fcw = self.sm['longitudinalPlan'].fcw and self.enabled
|
||||
model_fcw = self.sm['modelV2'].meta.hardBrakePredicted and not CS.brakePressed
|
||||
if planner_fcw or model_fcw:
|
||||
self.events.add(EventName.fcw)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user