Hyundai: use same gas pressed bit as in panda (#1428)

* use same bit as in panda

* remove lines

* update ref

* switch gas pedal signal
pull/1486/head
Willem Melching 5 years ago committed by GitHub
parent 1679f4a184
commit 94bba46d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      selfdrive/car/hyundai/carstate.py
  2. 2
      selfdrive/test/process_replay/ref_commit

@ -54,13 +54,8 @@ class CarState(CarStateBase):
ret.brakeLights = bool(cp.vl["TCS13"]['BrakeLight'] or ret.brakePressed)
#TODO: find pedal signal for EV/HYBRID Cars
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 = pedal_gas
ret.gas = cp.vl["EMS12"]['PV_AV_CAN'] / 100
ret.gasPressed = bool(cp.vl["EMS16"]["CF_Ems_AclAct"])
# TODO: refactor gear parsing in function
# Gear Selection via Cluster - For those Kia/Hyundai which are not fully discovered, we can use the Cluster Indicator for Gear Selection, as this seems to be standard over all cars, but is not the preferred method.
@ -163,10 +158,8 @@ class CarState(CarStateBase):
("CF_Clu_AliveCnt1", "CLU11", 0),
("ACCEnable", "TCS13", 0),
("ACC_REQ", "TCS13", 0),
("BrakeLight", "TCS13", 0),
("DriverBraking", "TCS13", 0),
("DriverOverride", "TCS13", 0),
("ESC_Off_Step", "TCS15", 0),
@ -187,7 +180,8 @@ class CarState(CarStateBase):
("ACC_ObjDist", "SCC11", 0),
("ACCMode", "SCC12", 1),
("TPS", "EMS12", 0),
("PV_AV_CAN", "EMS12", 0),
("CF_Ems_AclAct", "EMS16", 0),
]
checks = [
@ -204,6 +198,7 @@ class CarState(CarStateBase):
("SCC11", 50),
("SCC12", 50),
("EMS12", 100),
("EMS16", 100),
]
if CP.carFingerprint in FEATURES["use_cluster_gears"]:
signals += [

@ -1 +1 @@
6ac6d827e466d5c8cfc7c0bafb2cd62acea00645
783699128dfaeae66ecfd6ecd57ee19fe6d6e116
Loading…
Cancel
Save