From dc25e7c3e392944e0a5bd064fbeaaafe2e77c571 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 24 Jul 2023 16:47:19 -0700 Subject: [PATCH] boardd: handle false positive ignitions on red panda setups (#29126) --- selfdrive/boardd/boardd.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index a5203994fa..e6afe9f8fb 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -301,6 +301,10 @@ std::optional send_panda_states(PubMaster *pm, const std::vector std::vector> pandaCanStates; pandaCanStates.reserve(pandas_cnt); + const bool red_panda_comma_three = (pandas.size() == 2) && + (pandas[0]->hw_type == cereal::PandaState::PandaType::DOS) && + (pandas[1]->hw_type == cereal::PandaState::PandaType::RED_PANDA); + for (const auto& panda : pandas){ auto health_opt = panda->get_state(); if (!health_opt) { @@ -323,6 +327,13 @@ std::optional send_panda_states(PubMaster *pm, const std::vector health.ignition_line_pkt = 1; } + // on comma three setups with a red panda, the dos can + // get false positive ignitions due to the harness box + // without a harness connector, so ignore it + if (red_panda_comma_three && (panda->hw_type == cereal::PandaState::PandaType::DOS)) { + health.ignition_line_pkt = 0; + } + ignition_local |= ((health.ignition_line_pkt != 0) || (health.ignition_can_pkt != 0)); pandaStates.push_back(health);