Hyundai: fix gas and gasPressed signals (#1152)

* Hyundai: fix gas and gasPressed signals

* upd panda

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>

old-commit-hash: a817d1c1e7
commatwo_master
rbiasini 5 years ago committed by GitHub
parent f44d8df0bd
commit 19f0c3e249
  1. 2
      panda
  2. 13
      selfdrive/car/hyundai/carstate.py
  3. 2
      selfdrive/test/process_replay/ref_commit

@ -1 +1 @@
Subproject commit b2ffaae60ee73581f58b0cab757d5ac09db9dd5c
Subproject commit 1b49d3e830f6d894f9daf820f956f315fd951428

@ -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),

@ -1 +1 @@
bc912a9ead7664ae4e393a7dc7cd38ba733dd694
0d18f87c308ce685f1010b81b65c62780f2c0c35
Loading…
Cancel
Save