From d4cf34460acf2547479482bc983903f0faf9269e Mon Sep 17 00:00:00 2001 From: garrettpall <76917194+garrettpall@users.noreply.github.com> Date: Sat, 10 Aug 2024 12:19:21 -0400 Subject: [PATCH] [PEDAL] Update CAMERA_ACC_CAR gas pressed threshold --- panda/board/safety/safety_gm.h | 2 +- selfdrive/car/gm/carstate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/board/safety/safety_gm.h b/panda/board/safety/safety_gm.h index 214958bac1ddd5..426f1d9f6a5371 100644 --- a/panda/board/safety/safety_gm.h +++ b/panda/board/safety/safety_gm.h @@ -29,7 +29,7 @@ const int GM_STANDSTILL_THRSLD = 10; // 0.311kph // panda interceptor threshold needs to be equivalent to openpilot threshold to avoid controls mismatches // If thresholds are mismatched then it is possible for panda to see the gas fall and rise while openpilot is in the pre-enabled state -const int GM_GAS_INTERCEPTOR_THRESHOLD = 515; // (610 + 306.25) / 2 ratio between offset and gain from dbc file +const int GM_GAS_INTERCEPTOR_THRESHOLD = 515; // (675 + 355) / 2 ratio between offset and gain from dbc file #define GM_GET_INTERCEPTOR(msg) (((GET_BYTE((msg), 0) << 8) + GET_BYTE((msg), 1) + (GET_BYTE((msg), 2) << 8) + GET_BYTE((msg), 3)) / 2U) // avg between 2 tracks const CanMsg GM_ASCM_TX_MSGS[] = {{0x180, 0, 4}, {0x409, 0, 7}, {0x40A, 0, 7}, {0x2CB, 0, 8}, {0x370, 0, 6}, {0x200, 0, 6}, // pt bus diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index 12c2ccda31d78a..0eefee77abd75c 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -92,7 +92,7 @@ def update(self, pt_cp, cam_cp, loopback_cp): if self.CP.enableGasInterceptorDEPRECATED: ret.gas = (pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2. - threshold = 15 if self.CP.carFingerprint in CAMERA_ACC_CAR else 4 + threshold = 10 if self.CP.carFingerprint in CAMERA_ACC_CAR else 4 # Panda 515 threshold = 10.88. Set lower to avoid panda blocking messages and GasInterceptor faulting. ret.gasPressed = ret.gas > threshold else: ret.gas = pt_cp.vl["AcceleratorPedal2"]["AcceleratorPedal2"] / 254.