only force exit if actually actuating

This commit is contained in:
Jason Wen
2024-12-12 23:24:52 -05:00
parent 7fd83f056a
commit b3e1ecfa85
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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);
}
+2 -2
View File
@@ -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