|
|
@ -28,6 +28,7 @@ class CarState(CarStateBase): |
|
|
|
self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]["ACCButtons"] |
|
|
|
self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]["ACCButtons"] |
|
|
|
self.buttons_counter = pt_cp.vl["ASCMSteeringButton"]["RollingCounter"] |
|
|
|
self.buttons_counter = pt_cp.vl["ASCMSteeringButton"]["RollingCounter"] |
|
|
|
self.pscm_status = copy.copy(pt_cp.vl["PSCMStatus"]) |
|
|
|
self.pscm_status = copy.copy(pt_cp.vl["PSCMStatus"]) |
|
|
|
|
|
|
|
self.moving_backward = pt_cp.vl["EBCMWheelSpdRear"]["MovingBackward"] != 0 |
|
|
|
|
|
|
|
|
|
|
|
# Variables used for avoiding LKAS faults |
|
|
|
# Variables used for avoiding LKAS faults |
|
|
|
self.loopback_lka_steering_cmd_updated = len(loopback_cp.vl_all["ASCMLKASteeringCmd"]["RollingCounter"]) > 0 |
|
|
|
self.loopback_lka_steering_cmd_updated = len(loopback_cp.vl_all["ASCMLKASteeringCmd"]["RollingCounter"]) > 0 |
|
|
@ -39,16 +40,11 @@ class CarState(CarStateBase): |
|
|
|
pt_cp.vl["EBCMWheelSpdFront"]["FRWheelSpd"], |
|
|
|
pt_cp.vl["EBCMWheelSpdFront"]["FRWheelSpd"], |
|
|
|
pt_cp.vl["EBCMWheelSpdRear"]["RLWheelSpd"], |
|
|
|
pt_cp.vl["EBCMWheelSpdRear"]["RLWheelSpd"], |
|
|
|
pt_cp.vl["EBCMWheelSpdRear"]["RRWheelSpd"], |
|
|
|
pt_cp.vl["EBCMWheelSpdRear"]["RRWheelSpd"], |
|
|
|
unit=CV.KPH_TO_MS * (-1 if pt_cp.vl["EBCMWheelSpdRear"]["MovingBackward"] else 1), |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
ret.vEgoRaw = mean([ret.wheelSpeeds.fl, ret.wheelSpeeds.fr, ret.wheelSpeeds.rl, ret.wheelSpeeds.rr]) |
|
|
|
ret.vEgoRaw = mean([ret.wheelSpeeds.fl, ret.wheelSpeeds.fr, ret.wheelSpeeds.rl, ret.wheelSpeeds.rr]) |
|
|
|
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) |
|
|
|
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) |
|
|
|
# sample rear wheel speeds, standstill=True if ECM allows engagement with brake |
|
|
|
# sample rear wheel speeds, standstill=True if ECM allows engagement with brake |
|
|
|
# ret.standstill = abs(ret.wheelSpeeds.rl) <= STANDSTILL_THRESHOLD and abs(ret.wheelSpeeds.rr) <= STANDSTILL_THRESHOLD |
|
|
|
ret.standstill = ret.wheelSpeeds.rl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD |
|
|
|
ret.standstill = not any((pt_cp.vl["EBCMWheelSpdRear"]["MovingBackward"], |
|
|
|
|
|
|
|
pt_cp.vl["EBCMWheelSpdRear"]["MovingBackward2"], |
|
|
|
|
|
|
|
pt_cp.vl["EBCMWheelSpdRear"]["MovingForward"], |
|
|
|
|
|
|
|
pt_cp.vl["EBCMWheelSpdRear"]["MovingForward2"])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if pt_cp.vl["ECMPRDNL2"]["ManualMode"] == 1: |
|
|
|
if pt_cp.vl["ECMPRDNL2"]["ManualMode"] == 1: |
|
|
|
ret.gearShifter = self.parse_gear_shifter("T") |
|
|
|
ret.gearShifter = self.parse_gear_shifter("T") |
|
|
@ -144,10 +140,7 @@ class CarState(CarStateBase): |
|
|
|
("FRWheelSpd", "EBCMWheelSpdFront"), |
|
|
|
("FRWheelSpd", "EBCMWheelSpdFront"), |
|
|
|
("RLWheelSpd", "EBCMWheelSpdRear"), |
|
|
|
("RLWheelSpd", "EBCMWheelSpdRear"), |
|
|
|
("RRWheelSpd", "EBCMWheelSpdRear"), |
|
|
|
("RRWheelSpd", "EBCMWheelSpdRear"), |
|
|
|
("MovingForward", "EBCMWheelSpdRear"), |
|
|
|
|
|
|
|
("MovingForward2", "EBCMWheelSpdRear"), |
|
|
|
|
|
|
|
("MovingBackward", "EBCMWheelSpdRear"), |
|
|
|
("MovingBackward", "EBCMWheelSpdRear"), |
|
|
|
("MovingBackward2", "EBCMWheelSpdRear"), |
|
|
|
|
|
|
|
("PRNDL2", "ECMPRDNL2"), |
|
|
|
("PRNDL2", "ECMPRDNL2"), |
|
|
|
("ManualMode", "ECMPRDNL2"), |
|
|
|
("ManualMode", "ECMPRDNL2"), |
|
|
|
("LKADriverAppldTrq", "PSCMStatus"), |
|
|
|
("LKADriverAppldTrq", "PSCMStatus"), |
|
|
|