pull/30443/head
Shane Smiskol 2 years ago
parent 25d0fd01ff
commit 430d43b0cf
  1. 2
      opendbc
  2. 5
      selfdrive/car/honda/carstate.py
  3. 3
      selfdrive/car/toyota/interface.py

@ -1 +1 @@
Subproject commit 46f8be16366800f2552f9a0858ad7a6b66aa251c Subproject commit 75a15b6f32ae86810f0065ecf2470c5a50a15ec1

@ -224,12 +224,15 @@ class CarState(CarStateBase):
# switch is on for at least 2 consecutive CAN samples # switch is on for at least 2 consecutive CAN samples
# brake switch rises earlier than brake pressed but is never 1 when in park # brake switch rises earlier than brake pressed but is never 1 when in park
brake_switch_vals = cp.vl_all["POWERTRAIN_DATA"]["BRAKE_SWITCH"] brake_switch_vals = cp.vl_all["POWERTRAIN_DATA"]["BRAKE_SWITCH"]
brake_switch = cp.vl["POWERTRAIN_DATA"]["BRAKE_SWITCH"] != 0
print('brake_switch_vals', brake_switch_vals, int(brake_switch))
if len(brake_switch_vals): if len(brake_switch_vals):
brake_switch = cp.vl["POWERTRAIN_DATA"]["BRAKE_SWITCH"] != 0
if len(brake_switch_vals) > 1: if len(brake_switch_vals) > 1:
# assert False
self.brake_switch_prev = brake_switch_vals[-2] != 0 self.brake_switch_prev = brake_switch_vals[-2] != 0
self.brake_switch_active = brake_switch and self.brake_switch_prev self.brake_switch_active = brake_switch and self.brake_switch_prev
self.brake_switch_prev = brake_switch self.brake_switch_prev = brake_switch
print(cp.vl["POWERTRAIN_DATA"]["BRAKE_PRESSED"], self.brake_switch_active)
ret.brakePressed = (cp.vl["POWERTRAIN_DATA"]["BRAKE_PRESSED"] != 0) or self.brake_switch_active ret.brakePressed = (cp.vl["POWERTRAIN_DATA"]["BRAKE_PRESSED"] != 0) or self.brake_switch_active
ret.brake = cp.vl["VSA_STATUS"]["USER_BRAKE"] ret.brake = cp.vl["VSA_STATUS"]["USER_BRAKE"]

@ -215,7 +215,8 @@ class CarInterface(CarInterfaceBase):
found_ecus = [fw.ecu for fw in car_fw] found_ecus = [fw.ecu for fw in car_fw]
ret.enableDsu = len(found_ecus) > 0 and Ecu.dsu not in found_ecus and candidate not in (NO_DSU_CAR | UNSUPPORTED_DSU_CAR) \ ret.enableDsu = len(found_ecus) > 0 and Ecu.dsu not in found_ecus and candidate not in (NO_DSU_CAR | UNSUPPORTED_DSU_CAR) \
and not (ret.flags & ToyotaFlags.SMART_DSU) and not (ret.flags & ToyotaFlags.SMART_DSU)
ret.enableGasInterceptor = True # 0x201 in fingerprint[0] ret.enableGasInterceptor = 0x201 in fingerprint[0]
print('enableGasInterceptor', ret.enableGasInterceptor)
# if the smartDSU is detected, openpilot can send ACC_CONTROL and the smartDSU will block it from the DSU or radar. # if the smartDSU is detected, openpilot can send ACC_CONTROL and the smartDSU will block it from the DSU or radar.
# since we don't yet parse radar on TSS2/TSS-P radar-based ACC cars, gate longitudinal behind experimental toggle # since we don't yet parse radar on TSS2/TSS-P radar-based ACC cars, gate longitudinal behind experimental toggle

Loading…
Cancel
Save