diff --git a/selfdrive/pandad/pandad.cc b/selfdrive/pandad/pandad.cc index f4cdd84b9a..2abd4fbfff 100644 --- a/selfdrive/pandad/pandad.cc +++ b/selfdrive/pandad/pandad.cc @@ -367,7 +367,7 @@ void process_panda_state(std::vector &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); } diff --git a/sunnypilot/mads/mads.py b/sunnypilot/mads/mads.py index 871d0203a3..0477e1c59c 100644 --- a/sunnypilot/mads/mads.py +++ b/sunnypilot/mads/mads.py @@ -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