mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 13:02:09 +08:00
Subaru: ignore eyesight faults when openpilot is controlling long (#30390)
ignore eyesight faults old-commit-hash: f845c69b43ff56ad91236d0389f4721b6e9c6ecc
This commit is contained in:
@@ -95,8 +95,8 @@ class CarController:
|
||||
|
||||
else:
|
||||
if self.frame % 10 == 0:
|
||||
can_sends.append(subarucan.create_es_dashstatus(self.packer, self.frame // 10, CS.es_dashstatus_msg, CC.enabled, self.CP.openpilotLongitudinalControl,
|
||||
CC.longActive, hud_control.leadVisible))
|
||||
can_sends.append(subarucan.create_es_dashstatus(self.packer, self.frame // 10, CS.es_dashstatus_msg, CC.enabled,
|
||||
self.CP.openpilotLongitudinalControl, CC.longActive, hud_control.leadVisible))
|
||||
|
||||
can_sends.append(subarucan.create_es_lkas_state(self.packer, self.frame // 10, CS.es_lkas_state_msg, CC.enabled, hud_control.visualAlert,
|
||||
hud_control.leftLaneVisible, hud_control.rightLaneVisible,
|
||||
@@ -110,7 +110,8 @@ class CarController:
|
||||
can_sends.append(subarucan.create_es_status(self.packer, self.frame // 5, CS.es_status_msg,
|
||||
self.CP.openpilotLongitudinalControl, CC.longActive, cruise_rpm))
|
||||
|
||||
can_sends.append(subarucan.create_es_brake(self.packer, self.frame // 5, CS.es_brake_msg, CC.enabled, cruise_brake))
|
||||
can_sends.append(subarucan.create_es_brake(self.packer, self.frame // 5, CS.es_brake_msg,
|
||||
self.CP.openpilotLongitudinalControl, CC.longActive, cruise_brake))
|
||||
|
||||
can_sends.append(subarucan.create_es_distance(self.packer, self.frame // 5, CS.es_distance_msg, 0, pcm_cancel_cmd,
|
||||
self.CP.openpilotLongitudinalControl, cruise_brake > 0, cruise_throttle))
|
||||
|
||||
@@ -46,6 +46,7 @@ def create_es_distance(packer, frame, es_distance_msg, bus, pcm_cancel_cmd, long
|
||||
|
||||
# Do not disable openpilot on Eyesight Soft Disable, if openpilot is controlling long
|
||||
values["Cruise_Soft_Disable"] = 0
|
||||
values["Cruise_Fault"] = 0
|
||||
|
||||
if brake_cmd:
|
||||
values["Cruise_Brake_Active"] = 1
|
||||
@@ -160,6 +161,7 @@ def create_es_dashstatus(packer, frame, dashstatus_msg, enabled, long_enabled, l
|
||||
|
||||
if long_enabled:
|
||||
values["PCB_Off"] = 1 # AEB is not presevered, so show the PCB_Off on dash
|
||||
values["Cruise_Fault"] = 0
|
||||
|
||||
# Filter stock LKAS disabled and Keep hands on steering wheel OFF alerts
|
||||
if values["LKAS_State_Msg"] in (2, 3):
|
||||
@@ -167,7 +169,7 @@ def create_es_dashstatus(packer, frame, dashstatus_msg, enabled, long_enabled, l
|
||||
|
||||
return packer.make_can_msg("ES_DashStatus", CanBus.main, values)
|
||||
|
||||
def create_es_brake(packer, frame, es_brake_msg, enabled, brake_value):
|
||||
def create_es_brake(packer, frame, es_brake_msg, long_enabled, long_active, brake_value):
|
||||
values = {s: es_brake_msg[s] for s in [
|
||||
"CHECKSUM",
|
||||
"Signal1",
|
||||
@@ -182,8 +184,11 @@ def create_es_brake(packer, frame, es_brake_msg, enabled, brake_value):
|
||||
|
||||
values["COUNTER"] = frame % 0x10
|
||||
|
||||
if enabled:
|
||||
values["Cruise_Activated"] = 1
|
||||
if long_enabled:
|
||||
values["Cruise_Brake_Fault"] = 0
|
||||
|
||||
if long_active:
|
||||
values["Cruise_Activated"] = 1
|
||||
|
||||
values["Brake_Pressure"] = brake_value
|
||||
|
||||
@@ -210,6 +215,7 @@ def create_es_status(packer, frame, es_status_msg, long_enabled, long_active, cr
|
||||
|
||||
if long_enabled:
|
||||
values["Cruise_RPM"] = cruise_rpm
|
||||
values["Cruise_Fault"] = 0
|
||||
|
||||
if long_active:
|
||||
values["Cruise_Activated"] = 1
|
||||
|
||||
Reference in New Issue
Block a user