mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-30 21:23:43 +08:00
only force exit if actually actuating
This commit is contained in:
@@ -367,7 +367,7 @@ void process_panda_state(std::vector<Panda *> &pandas, PubMaster *pm, bool spoof
|
||||
|
||||
sm.update(0);
|
||||
const bool engaged = sm.allAliveAndValid({"selfdriveState"}) && sm["selfdriveState"].getSelfdriveState().getEnabled();
|
||||
const bool engaged_mads = sm.allAliveAndValid({"selfdriveStateSP"}) && sm["selfdriveStateSP"].getSelfdriveStateSP().getMads().getEnabled();
|
||||
const bool engaged_mads = sm.allAliveAndValid({"selfdriveStateSP"}) && sm["selfdriveStateSP"].getSelfdriveStateSP().getMads().getActive();
|
||||
for (const auto &panda : pandas) {
|
||||
panda->send_heartbeat(engaged, engaged_mads);
|
||||
}
|
||||
|
||||
@@ -140,10 +140,10 @@ class ModularAssistiveDrivingSystem:
|
||||
self.events.add(EventName.controlsMismatchLateral)
|
||||
|
||||
def data_sample(self, sm: messaging.SubMaster):
|
||||
if not self.enabled:
|
||||
if not self.active:
|
||||
self.mismatch_counter = 0
|
||||
|
||||
if self.enabled and any(not ps.controlsAllowedLat for ps in sm['pandaStates']
|
||||
if self.active and any(not ps.controlsAllowedLat for ps in sm['pandaStates']
|
||||
if ps.safetyModel not in IGNORED_SAFETY_MODES):
|
||||
self.mismatch_counter += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user