mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +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: 38f775edfc12736f590885705c3a92a785d531f8
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