mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 20:12:07 +08:00
Subaru Pre-Global: Rename ES_CruiseThrottle to ES_Distance (#23024)
* Rename preglobal ES_CruiseThrottle to ES_Distance * bump opendbc Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> old-commit-hash: 345fe48338fe4d95a88d9f001484a56e4a146ac4
This commit is contained in:
+1
-1
Submodule opendbc updated: 61534fd131...2bab99fd86
@@ -8,7 +8,6 @@ class CarController():
|
||||
def __init__(self, dbc_name, CP, VM):
|
||||
self.apply_steer_last = 0
|
||||
self.es_distance_cnt = -1
|
||||
self.es_accel_cnt = -1
|
||||
self.es_lkas_cnt = -1
|
||||
self.cruise_button_prev = 0
|
||||
self.steer_rate_limited = False
|
||||
@@ -44,7 +43,7 @@ class CarController():
|
||||
# *** alerts and pcm cancel ***
|
||||
|
||||
if CS.CP.carFingerprint in PREGLOBAL_CARS:
|
||||
if self.es_accel_cnt != CS.es_accel_msg["Counter"]:
|
||||
if self.es_distance_cnt != CS.es_distance_msg["Counter"]:
|
||||
# 1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 = resume deep
|
||||
# disengage ACC when OP is disengaged
|
||||
if pcm_cancel_cmd:
|
||||
@@ -60,8 +59,8 @@ class CarController():
|
||||
cruise_button = 0
|
||||
self.cruise_button_prev = cruise_button
|
||||
|
||||
can_sends.append(subarucan.create_es_throttle_control(self.packer, cruise_button, CS.es_accel_msg))
|
||||
self.es_accel_cnt = CS.es_accel_msg["Counter"]
|
||||
can_sends.append(subarucan.create_preglobal_es_distance(self.packer, cruise_button, CS.es_distance_msg))
|
||||
self.es_distance_cnt = CS.es_distance_msg["Counter"]
|
||||
|
||||
else:
|
||||
if self.es_distance_cnt != CS.es_distance_msg["Counter"]:
|
||||
|
||||
@@ -65,14 +65,13 @@ class CarState(CarStateBase):
|
||||
ret.steerError = cp.vl["Steering_Torque"]["Steer_Error_1"] == 1
|
||||
|
||||
if self.car_fingerprint in PREGLOBAL_CARS:
|
||||
self.cruise_button = cp_cam.vl["ES_CruiseThrottle"]["Cruise_Button"]
|
||||
self.cruise_button = cp_cam.vl["ES_Distance"]["Cruise_Button"]
|
||||
self.ready = not cp_cam.vl["ES_DashStatus"]["Not_Ready_Startup"]
|
||||
self.es_accel_msg = copy.copy(cp_cam.vl["ES_CruiseThrottle"])
|
||||
else:
|
||||
ret.steerWarning = cp.vl["Steering_Torque"]["Steer_Warning"] == 1
|
||||
ret.cruiseState.nonAdaptive = cp_cam.vl["ES_DashStatus"]["Conventional_Cruise"] == 1
|
||||
self.es_distance_msg = copy.copy(cp_cam.vl["ES_Distance"])
|
||||
self.es_lkas_msg = copy.copy(cp_cam.vl["ES_LKAS_State"])
|
||||
self.es_distance_msg = copy.copy(cp_cam.vl["ES_Distance"])
|
||||
|
||||
return ret
|
||||
|
||||
@@ -168,28 +167,28 @@ class CarState(CarStateBase):
|
||||
("Cruise_Set_Speed", "ES_DashStatus", 0),
|
||||
("Not_Ready_Startup", "ES_DashStatus", 0),
|
||||
|
||||
("Throttle_Cruise", "ES_CruiseThrottle", 0),
|
||||
("Signal1", "ES_CruiseThrottle", 0),
|
||||
("Cruise_Activated", "ES_CruiseThrottle", 0),
|
||||
("Signal2", "ES_CruiseThrottle", 0),
|
||||
("Brake_On", "ES_CruiseThrottle", 0),
|
||||
("Distance_Swap", "ES_CruiseThrottle", 0),
|
||||
("Standstill", "ES_CruiseThrottle", 0),
|
||||
("Signal3", "ES_CruiseThrottle", 0),
|
||||
("Close_Distance", "ES_CruiseThrottle", 0),
|
||||
("Signal4", "ES_CruiseThrottle", 0),
|
||||
("Standstill_2", "ES_CruiseThrottle", 0),
|
||||
("Cruise_Fault", "ES_CruiseThrottle", 0),
|
||||
("Signal5", "ES_CruiseThrottle", 0),
|
||||
("Counter", "ES_CruiseThrottle", 0),
|
||||
("Signal6", "ES_CruiseThrottle", 0),
|
||||
("Cruise_Button", "ES_CruiseThrottle", 0),
|
||||
("Signal7", "ES_CruiseThrottle", 0),
|
||||
("Cruise_Throttle", "ES_Distance", 0),
|
||||
("Signal1", "ES_Distance", 0),
|
||||
("Car_Follow", "ES_Distance", 0),
|
||||
("Signal2", "ES_Distance", 0),
|
||||
("Brake_On", "ES_Distance", 0),
|
||||
("Distance_Swap", "ES_Distance", 0),
|
||||
("Standstill", "ES_Distance", 0),
|
||||
("Signal3", "ES_Distance", 0),
|
||||
("Close_Distance", "ES_Distance", 0),
|
||||
("Signal4", "ES_Distance", 0),
|
||||
("Standstill_2", "ES_Distance", 0),
|
||||
("Cruise_Fault", "ES_Distance", 0),
|
||||
("Signal5", "ES_Distance", 0),
|
||||
("Counter", "ES_Distance", 0),
|
||||
("Signal6", "ES_Distance", 0),
|
||||
("Cruise_Button", "ES_Distance", 0),
|
||||
("Signal7", "ES_Distance", 0),
|
||||
]
|
||||
|
||||
checks = [
|
||||
("ES_DashStatus", 20),
|
||||
("ES_CruiseThrottle", 20),
|
||||
("ES_Distance", 20),
|
||||
]
|
||||
else:
|
||||
signals = [
|
||||
|
||||
@@ -80,11 +80,11 @@ def create_preglobal_steering_control(packer, apply_steer, frame, steer_step):
|
||||
|
||||
return packer.make_can_msg("ES_LKAS", 0, values)
|
||||
|
||||
def create_es_throttle_control(packer, cruise_button, es_accel_msg):
|
||||
def create_preglobal_es_distance(packer, cruise_button, es_distance_msg):
|
||||
|
||||
values = copy.copy(es_accel_msg)
|
||||
values = copy.copy(es_distance_msg)
|
||||
values["Cruise_Button"] = cruise_button
|
||||
|
||||
values["Checksum"] = subaru_preglobal_checksum(packer, values, "ES_CruiseThrottle")
|
||||
values["Checksum"] = subaru_preglobal_checksum(packer, values, "ES_Distance")
|
||||
|
||||
return packer.make_can_msg("ES_CruiseThrottle", 0, values)
|
||||
return packer.make_can_msg("ES_Distance", 0, values)
|
||||
|
||||
Reference in New Issue
Block a user