From 0c18b556ead0333f26e0431adf01f61ca0fed55c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 14 Dec 2023 16:53:22 -0800 Subject: [PATCH] Use a safety param for gas interceptor (#30719) * bump * bump * space * remove from boardd * set flag for honda to pass tests * migrate * Update ref_commit * final bump * bump cereal * bump to master old-commit-hash: 582743fdb5a20fbbe841aa154cf36304771d52a6 --- cereal | 2 +- panda | 2 +- selfdrive/boardd/boardd.cc | 1 - selfdrive/car/honda/interface.py | 3 +++ selfdrive/car/toyota/interface.py | 3 +++ selfdrive/test/process_replay/migration.py | 2 +- selfdrive/test/process_replay/ref_commit | 2 +- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cereal b/cereal index d11688a90a..8ae5c51a65 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit d11688a90a1cebacb3fe00dcfbba5f27551b2d89 +Subproject commit 8ae5c51a6515c171f3a82c9511a18d79a9e55c07 diff --git a/panda b/panda index a88fe8c883..bb75afc84e 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit a88fe8c883758951ba2854eb2f6726d5365df099 +Subproject commit bb75afc84e4d33af1554ada81851547db648e33e diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index 61e2424744..9e2a960055 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -351,7 +351,6 @@ std::optional send_panda_states(PubMaster *pm, const std::vector ps.setIgnitionLine(health.ignition_line_pkt); ps.setIgnitionCan(health.ignition_can_pkt); ps.setControlsAllowed(health.controls_allowed_pkt); - ps.setGasInterceptorDetected(health.gas_interceptor_detected_pkt); ps.setTxBufferOverflow(health.tx_buffer_overflow_pkt); ps.setRxBufferOverflow(health.rx_buffer_overflow_pkt); ps.setGmlanSendErrs(health.gmlan_send_errs_pkt); diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index d1a287a76a..9f228cd8fb 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -285,6 +285,9 @@ class CarInterface(CarInterfaceBase): if ret.openpilotLongitudinalControl and candidate in HONDA_BOSCH: ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_BOSCH_LONG + if ret.enableGasInterceptor and candidate not in HONDA_BOSCH: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_GAS_INTERCEPTOR + if candidate in HONDA_BOSCH_RADARLESS: ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_RADARLESS diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index ae4cb1f2c5..b5151f4cda 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -222,6 +222,9 @@ class CarInterface(CarInterfaceBase): and not (ret.flags & ToyotaFlags.SMART_DSU) ret.enableGasInterceptor = 0x201 in fingerprint[0] + if ret.enableGasInterceptor: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_TOYOTA_GAS_INTERCEPTOR + # if the smartDSU is detected, openpilot can send ACC_CONTROL and the smartDSU will block it from the DSU or radar. # since we don't yet parse radar on TSS2/TSS-P radar-based ACC cars, gate longitudinal behind experimental toggle use_sdsu = bool(ret.flags & ToyotaFlags.SMART_DSU) diff --git a/selfdrive/test/process_replay/migration.py b/selfdrive/test/process_replay/migration.py index 831bea7c6f..ef74314172 100644 --- a/selfdrive/test/process_replay/migration.py +++ b/selfdrive/test/process_replay/migration.py @@ -40,7 +40,7 @@ def migrate_pandaStates(lr): # TODO: safety param migration should be handled automatically safety_param_migration = { "TOYOTA PRIUS 2017": EPS_SCALE["TOYOTA PRIUS 2017"] | Panda.FLAG_TOYOTA_STOCK_LONGITUDINAL, - "TOYOTA RAV4 2017": EPS_SCALE["TOYOTA RAV4 2017"] | Panda.FLAG_TOYOTA_ALT_BRAKE, + "TOYOTA RAV4 2017": EPS_SCALE["TOYOTA RAV4 2017"] | Panda.FLAG_TOYOTA_ALT_BRAKE | Panda.FLAG_TOYOTA_GAS_INTERCEPTOR, "KIA EV6 2022": Panda.FLAG_HYUNDAI_EV_GAS | Panda.FLAG_HYUNDAI_CANFD_HDA2, } diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 030cbc4e07..559749be14 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -921222d49db204071f0a7006fc895690e1045b5d \ No newline at end of file +ea96f935a7a16c53623c3b03e70c0fbfa6b249e7