From 989af0a6b06f91e2ff381b80ed46838245b90f70 Mon Sep 17 00:00:00 2001 From: martinl Date: Wed, 29 Sep 2021 08:00:35 +0300 Subject: [PATCH] Subaru: update brake pressed signal (#21012) * Change Global brakePressed to Brake_Status Brake signal * Add Brake_Status Brake signal and check * bump panda * update refs Co-authored-by: Adeeb Shihadeh old-commit-hash: 4c45e907221395bf02cdfa49012f815028cf41dc --- panda | 2 +- selfdrive/car/subaru/carstate.py | 4 +++- selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/panda b/panda index dd22fafc3c..5ab46ab70a 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit dd22fafc3c9f36c9d96dffee5437fb9f56d7ff6d +Subproject commit 5ab46ab70a4a6b97acb4d89b9452074f70619dd6 diff --git a/selfdrive/car/subaru/carstate.py b/selfdrive/car/subaru/carstate.py index 8ff9dad38a..e324037766 100644 --- a/selfdrive/car/subaru/carstate.py +++ b/selfdrive/car/subaru/carstate.py @@ -21,7 +21,7 @@ class CarState(CarStateBase): if self.car_fingerprint in PREGLOBAL_CARS: ret.brakePressed = cp.vl["Brake_Pedal"]["Brake_Pedal"] > 2 else: - ret.brakePressed = cp.vl["Brake_Pedal"]["Brake_Pedal"] > 1e-5 + ret.brakePressed = cp.vl["Brake_Status"]["Brake"] == 1 ret.wheelSpeeds.fl = cp.vl["Wheel_Speeds"]["FL"] * CV.KPH_TO_MS ret.wheelSpeeds.fr = cp.vl["Wheel_Speeds"]["FR"] * CV.KPH_TO_MS @@ -125,12 +125,14 @@ class CarState(CarStateBase): if CP.carFingerprint not in PREGLOBAL_CARS: signals += [ ("Steer_Warning", "Steering_Torque", 0), + ("Brake", "Brake_Status", 0), ("UNITS", "Dashlights", 0), ] checks += [ ("Dashlights", 10), ("BodyInfo", 10), + ("Brake_Status", 50), ("CruiseControl", 20), ] else: diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 4a4f92a488..e43b5d39eb 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -5874cd1594e1a9dde61590bf7ff21276427ed555 \ No newline at end of file +58c5a740a25da4e70899a0466c336a7b5838f394 \ No newline at end of file