mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-11-05 05:53:44 +08:00
Merge branch 'SP-121-upstream-platform-fixes' into master-dev-c3
This commit is contained in:
@@ -78,7 +78,7 @@ def get_can_messages(CP, gearbox_msg):
|
||||
|
||||
if CP.carFingerprint in HONDA_BOSCH_RADARLESS:
|
||||
messages.append(("CRUISE_FAULT_STATUS", 50))
|
||||
elif CP.carFingerprint == CAR.CLARITY:
|
||||
elif CP.carFingerprint == CAR.HONDA_CLARITY:
|
||||
messages.append(("BRAKE_ERROR", 100)),
|
||||
elif CP.openpilotLongitudinalControl:
|
||||
messages.append(("STANDSTILL", 50))
|
||||
@@ -150,7 +150,7 @@ class CarState(CarStateBase):
|
||||
|
||||
if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS:
|
||||
ret.accFaulted = bool(cp.vl["CRUISE_FAULT_STATUS"]["CRUISE_FAULT"])
|
||||
elif self.CP.carFingerprint == CAR.CLARITY:
|
||||
elif self.CP.carFingerprint == CAR.HONDA_CLARITY:
|
||||
ret.accFaulted = bool(cp.vl["BRAKE_ERROR"]["BRAKE_ERROR_1"] or cp.vl["BRAKE_ERROR"]["BRAKE_ERROR_2"])
|
||||
else:
|
||||
# On some cars, these two signals are always 1, this flag is masking a bug in release
|
||||
@@ -250,12 +250,12 @@ class CarState(CarStateBase):
|
||||
if ret.brake > 0.1:
|
||||
ret.brakePressed = True
|
||||
|
||||
if self.CP.carFingerprint in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH,
|
||||
CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E):
|
||||
if self.CP.carFingerprint in (CAR.HONDA_CIVIC, CAR.HONDA_ODYSSEY, CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_CRV_5G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH,
|
||||
CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.ACURA_RDX_3G, CAR.HONDA_E):
|
||||
ret.brakeLightsDEPRECATED = bool(cp.vl["ACC_CONTROL"]['BRAKE_LIGHTS'] != 0 or ret.brake > 0.4) if not self.CP.openpilotLongitudinalControl else \
|
||||
bool(ret.brake > 0.4)
|
||||
elif self.CP.carFingerprint in HONDA_BOSCH and self.CP.carFingerprint not in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH,
|
||||
CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E) and self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS:
|
||||
elif self.CP.carFingerprint in HONDA_BOSCH and self.CP.carFingerprint not in (CAR.HONDA_CIVIC, CAR.HONDA_ODYSSEY, CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_CRV_5G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH,
|
||||
CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.ACURA_RDX_3G, CAR.HONDA_E) and self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS:
|
||||
ret.brakeLightsDEPRECATED = bool(cp.vl["ACC_CONTROL"]['BRAKE_LIGHTS'] != 0 or ret.brake > 0.4) if not self.CP.openpilotLongitudinalControl else \
|
||||
bool(ret.brake > 0.4)
|
||||
|
||||
@@ -264,7 +264,7 @@ class CarState(CarStateBase):
|
||||
if self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS:
|
||||
ret.stockAeb = (not self.CP.openpilotLongitudinalControl) and bool(cp.vl["ACC_CONTROL"]["AEB_STATUS"] and cp.vl["ACC_CONTROL"]["ACCEL_COMMAND"] < -1e-5)
|
||||
else:
|
||||
aeb_sig = "COMPUTER_BRAKE_ALT" if self.CP.carFingerprint == CAR.CLARITY else "COMPUTER_BRAKE"
|
||||
aeb_sig = "COMPUTER_BRAKE_ALT" if self.CP.carFingerprint == CAR.HONDA_CLARITY else "COMPUTER_BRAKE"
|
||||
ret.stockAeb = bool(cp_cam.vl["BRAKE_COMMAND"]["AEB_REQ_1"] and cp_cam.vl["BRAKE_COMMAND"][aeb_sig] > 1e-5)
|
||||
|
||||
self.acc_hud = False
|
||||
|
||||
@@ -104,7 +104,7 @@ class CarState(CarStateBase):
|
||||
|
||||
ret.standstill = abs(ret.vEgoRaw) < 1e-3
|
||||
|
||||
if self.CP.carFingerprint != CAR.PRIUS_V:
|
||||
if self.CP.carFingerprint != CAR.TOYOTA_PRIUS_V:
|
||||
self.lta_status = cp_cam.vl["LKAS_HUD"]["SET_ME_X02"]
|
||||
if ((self.prev_lta_status == 16 and self.lta_status == 0) or
|
||||
(self.prev_lta_status == 0 and self.lta_status == 16)) and not self.lta_status_active:
|
||||
@@ -113,7 +113,7 @@ class CarState(CarStateBase):
|
||||
self.prev_lta_status = self.lta_status
|
||||
if self.lta_status_active:
|
||||
self.lkas_enabled = self.lta_status
|
||||
elif self.CP.carFingerprint != CAR.PRIUS_V:
|
||||
elif self.CP.carFingerprint != CAR.TOYOTA_PRIUS_V:
|
||||
self.lkas_enabled = cp_cam.vl["LKAS_HUD"]["LKAS_STATUS"]
|
||||
if self.prev_lkas_enabled is None:
|
||||
self.prev_lkas_enabled = self.lkas_enabled
|
||||
|
||||
Reference in New Issue
Block a user