From a817d1c1e7e380262b511d9ae76e513dcce0729c Mon Sep 17 00:00:00 2001 From: rbiasini Date: Sat, 22 Feb 2020 20:46:27 -0800 Subject: [PATCH] Hyundai: fix gas and gasPressed signals (#1152) * Hyundai: fix gas and gasPressed signals * upd panda * update ref Co-authored-by: Willem Melching --- panda | 2 +- selfdrive/car/hyundai/carstate.py | 13 ++++--------- selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/panda b/panda index b2ffaae60e..1b49d3e830 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit b2ffaae60ee73581f58b0cab757d5ac09db9dd5c +Subproject commit 1b49d3e830f6d894f9daf820f956f315fd951428 diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index d3e62b0c64..59c825f44d 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -46,12 +46,8 @@ class CarState(CarStateBase): ret.brake = 0 # FIXME ret.brakePressed = cp.vl["TCS13"]['DriverBraking'] != 0 ret.brakeLights = ret.brakePressed - if (cp.vl["TCS13"]["DriverOverride"] == 0 and cp.vl["TCS13"]['ACC_REQ'] == 1): - pedal_gas = 0 - else: - pedal_gas = cp.vl["EMS12"]['TPS'] - ret.gasPressed = pedal_gas > 1e-3 - ret.gas = cp.vl["EMS12"]['TPS'] + ret.gas = cp.vl["EMS12"]['PV_AV_CAN'] / 100 + ret.gasPressed = cp.vl["EMS16"]["CF_Ems_AclAct"] != 0 ret.espDisabled = cp.vl["TCS15"]['ESC_Off_Step'] != 0 # Gear Selecton - This is not compatible with all Kia/Hyundai's, But is the best way for those it is compatible with @@ -131,7 +127,7 @@ class CarState(CarStateBase): ("BRAKE_ACT", "EMS12", 0), ("PV_AV_CAN", "EMS12", 0), - ("TPS", "EMS12", 0), + ("CF_Ems_AclAct", "EMS16", 0), ("CYL_PRES", "ESP12", 0), @@ -157,9 +153,7 @@ class CarState(CarStateBase): ("CUR_GR", "TCU12",0), ("ACCEnable", "TCS13", 0), - ("ACC_REQ", "TCS13", 0), ("DriverBraking", "TCS13", 0), - ("DriverOverride", "TCS13", 0), ("ESC_Off_Step", "TCS15", 0), @@ -190,6 +184,7 @@ class CarState(CarStateBase): ("CLU11", 50), ("ESP12", 100), ("EMS12", 100), + ("EMS16", 100), ("CGW1", 10), ("CGW4", 5), ("WHL_SPD11", 50), diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index d4b1ef5914..81191df4b9 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -bc912a9ead7664ae4e393a7dc7cd38ba733dd694 \ No newline at end of file +0d18f87c308ce685f1010b81b65c62780f2c0c35 \ No newline at end of file