From 17fbe1a4dd490ac394ea38fcf63aa6fcdebbe14b Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Sun, 17 Feb 2019 10:46:07 +1000 Subject: [PATCH] getting error from last change, revert a couple back. --- selfdrive/car/toyota/carstate.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index de37618a4..1dcf9dff5 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -39,12 +39,12 @@ def get_can_parser(CP): ("CRUISE_STATE", "PCM_CRUISE", 0), ("MAIN_ON", "PCM_CRUISE_2", 0), ("SET_SPEED", "PCM_CRUISE_2", 0), - ("LOW_SPEED_LOCKOUT", "PCM_CRUISE_2", 0), + # ("LOW_SPEED_LOCKOUT", "PCM_CRUISE_2", 0), ("STEER_TORQUE_DRIVER", "STEER_TORQUE_SENSOR", 0), ("STEER_TORQUE_EPS", "STEER_TORQUE_SENSOR", 0), ("TURN_SIGNALS", "STEERING_LEVERS", 3), # 3 is no blinkers ("LKA_STATE", "EPS_STATUS", 0), - ("IPAS_STATE", "EPS_STATUS", 1), + # ("IPAS_STATE", "EPS_STATUS", 1), ("BRAKE_LIGHTS_ACC", "ESP_CONTROL", 0), ("AUTO_HIGH_BEAM", "LIGHT_STALK", 0), ] @@ -60,7 +60,7 @@ def get_can_parser(CP): ("EPS_STATUS", 25), ] - # if not CP.carFingerprint == CAR.LEXUS_ISH: + if not CP.carFingerprint == CAR.LEXUS_ISH: # checks = [ # ("BRAKE_MODULE", 50), # ("GAS_PEDAL", 50), @@ -72,10 +72,10 @@ def get_can_parser(CP): # ("EPS_STATUS", 25), # ] # else: - # signals += [ - # ("LOW_SPEED_LOCKOUT", "PCM_CRUISE_2", 0), - # ("IPAS_STATE", "EPS_STATUS", 1), - # ] + signals += [ + ("LOW_SPEED_LOCKOUT", "PCM_CRUISE_2", 0), + ("IPAS_STATE", "EPS_STATUS", 1), + ] if CP.carFingerprint == CAR.PRIUS: signals += [("STATE", "AUTOPARK_STATUS", 0)] @@ -161,10 +161,10 @@ class CarState(object): # 2 is standby, 10 is active. TODO: check that everything else is really a faulty state self.steer_state = cp.vl["EPS_STATUS"]['LKA_STATE'] self.steer_error = cp.vl["EPS_STATUS"]['LKA_STATE'] not in [1, 5] - # if self.CP.carFingerprint == CAR.LEXUS_ISH: - # self.ipas_active = False - # else: - self.ipas_active = cp.vl['EPS_STATUS']['IPAS_STATE'] == 3 + if self.CP.carFingerprint == CAR.LEXUS_ISH: + self.ipas_active = False + else: + self.ipas_active = cp.vl['EPS_STATUS']['IPAS_STATE'] == 3 self.brake_error = 0 self.steer_torque_driver = cp.vl["STEER_TORQUE_SENSOR"]['STEER_TORQUE_DRIVER'] self.steer_torque_motor = cp.vl["STEER_TORQUE_SENSOR"]['STEER_TORQUE_EPS'] @@ -176,10 +176,10 @@ class CarState(object): self.pcm_acc_status = cp.vl["PCM_CRUISE"]['CRUISE_STATE'] self.pcm_acc_active = bool(cp.vl["PCM_CRUISE"]['CRUISE_ACTIVE']) self.gas_pressed = not cp.vl["PCM_CRUISE"]['GAS_RELEASED'] - # if self.CP.carFingerprint == CAR.LEXUS_ISH: - # self.low_speed_lockout = False - # else: - self.low_speed_lockout = cp.vl["PCM_CRUISE_2"]['LOW_SPEED_LOCKOUT'] == 2 + if self.CP.carFingerprint == CAR.LEXUS_ISH: + self.low_speed_lockout = False + else: + self.low_speed_lockout = cp.vl["PCM_CRUISE_2"]['LOW_SPEED_LOCKOUT'] == 2 self.brake_lights = bool(cp.vl["ESP_CONTROL"]['BRAKE_LIGHTS_ACC'] or self.brake_pressed) if self.CP.carFingerprint == CAR.PRIUS: self.generic_toggle = cp.vl["AUTOPARK_STATUS"]['STATE'] != 0