mirror of https://github.com/commaai/openpilot.git
Subaru Global generated dbc and new signals (#1908)
* Change carstate signals to use feature-subaru-long dbc
* Add Conventional_Cruise signal to carstate
* Fix Conventional_Cruise signal source
* Use Cruise_Cancel signal in subarucan
* switch to subaru-global-2020 opendbc branch
* Update release file
* bump opendbc
* switch panda to subaru-global-carstate branch
* bump panda
* bump opendbc
* revert submodules for upstream PR
* switch panda and opendbc to upstream
* bump opendbc
old-commit-hash: a086f52881
This commit is contained in:
parent
591dcc26ee
commit
54e4939168
2
opendbc
2
opendbc
|
@ -1 +1 @@
|
|||
Subproject commit 993f0cc650a1cc4915de8cade1b278acf57f5483
|
||||
Subproject commit efb1e38aec6949e738da5252f9a5839cb28ea2c8
|
|
@ -529,7 +529,7 @@ opendbc/mazda_2017.dbc
|
|||
opendbc/nissan_x_trail_2017.dbc
|
||||
opendbc/nissan_leaf_2018.dbc
|
||||
|
||||
opendbc/subaru_global_2017.dbc
|
||||
opendbc/subaru_global_2017_generated.dbc
|
||||
|
||||
opendbc/toyota_rav4_hybrid_2017_pt_generated.dbc
|
||||
opendbc/toyota_rav4_2017_pt_generated.dbc
|
||||
|
|
|
@ -48,11 +48,15 @@ class CarState(CarStateBase):
|
|||
ret.steeringTorque = cp.vl["Steering_Torque"]['Steer_Torque_Sensor']
|
||||
ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD[self.car_fingerprint]
|
||||
|
||||
ret.steerError = cp.vl["Steering_Torque"]['Steer_Error_1'] == 1
|
||||
ret.steerWarning = cp.vl["Steering_Torque"]['Steer_Warning'] == 1
|
||||
|
||||
ret.cruiseState.enabled = cp.vl["CruiseControl"]['Cruise_Activated'] != 0
|
||||
ret.cruiseState.available = cp.vl["CruiseControl"]['Cruise_On'] != 0
|
||||
ret.cruiseState.speed = cp_cam.vl["ES_DashStatus"]['Cruise_Set_Speed'] * CV.KPH_TO_MS
|
||||
# EDM Impreza: 1 = mph, UDM Forester: 7 = mph
|
||||
if cp.vl["Dash_State"]['Units'] in [1, 7]:
|
||||
ret.cruiseState.nonAdaptive = cp_cam.vl["ES_DashStatus"]['Conventional_Cruise'] == 1
|
||||
# EDM Impreza: 1,2 = mph, UDM Forester: 7 = mph
|
||||
if cp.vl["Dash_State"]['Units'] in [1, 2, 7]:
|
||||
ret.cruiseState.speed *= CV.MPH_TO_KPH
|
||||
|
||||
ret.seatbeltUnlatched = cp.vl["Dashlights"]['SEATBELT_FL'] == 1
|
||||
|
@ -73,6 +77,8 @@ class CarState(CarStateBase):
|
|||
# sig_name, sig_address, default
|
||||
("Steer_Torque_Sensor", "Steering_Torque", 0),
|
||||
("Steering_Angle", "Steering_Torque", 0),
|
||||
("Steer_Error_1", "Steering_Torque", 0),
|
||||
("Steer_Warning", "Steering_Torque", 0),
|
||||
("Cruise_On", "CruiseControl", 0),
|
||||
("Cruise_Activated", "CruiseControl", 0),
|
||||
("Brake_Pedal", "Brake_Pedal", 0),
|
||||
|
@ -111,12 +117,25 @@ class CarState(CarStateBase):
|
|||
def get_cam_can_parser(CP):
|
||||
signals = [
|
||||
("Cruise_Set_Speed", "ES_DashStatus", 0),
|
||||
("Conventional_Cruise", "ES_DashStatus", 0),
|
||||
|
||||
("Counter", "ES_Distance", 0),
|
||||
("Signal1", "ES_Distance", 0),
|
||||
("Cruise_Fault", "ES_Distance", 0),
|
||||
("Cruise_Throttle", "ES_Distance", 0),
|
||||
("Signal2", "ES_Distance", 0),
|
||||
("Main", "ES_Distance", 0),
|
||||
("Car_Follow", "ES_Distance", 0),
|
||||
("Signal3", "ES_Distance", 0),
|
||||
("Cruise_Brake_Active", "ES_Distance", 0),
|
||||
("Distance_Swap", "ES_Distance", 0),
|
||||
("Cruise_EPB", "ES_Distance", 0),
|
||||
("Signal4", "ES_Distance", 0),
|
||||
("Close_Distance", "ES_Distance", 0),
|
||||
("Signal5", "ES_Distance", 0),
|
||||
("Cruise_Cancel", "ES_Distance", 0),
|
||||
("Cruise_Set", "ES_Distance", 0),
|
||||
("Cruise_Resume", "ES_Distance", 0),
|
||||
("Signal6", "ES_Distance", 0),
|
||||
|
||||
("Counter", "ES_LKAS_State", 0),
|
||||
("Keep_Hands_On_Wheel", "ES_LKAS_State", 0),
|
||||
|
@ -126,23 +145,21 @@ class CarState(CarStateBase):
|
|||
("Signal2", "ES_LKAS_State", 0),
|
||||
("Backward_Speed_Limit_Menu", "ES_LKAS_State", 0),
|
||||
("LKAS_ENABLE_3", "ES_LKAS_State", 0),
|
||||
("Signal3", "ES_LKAS_State", 0),
|
||||
("LKAS_Left_Line_Light_Blink", "ES_LKAS_State", 0),
|
||||
("LKAS_ENABLE_2", "ES_LKAS_State", 0),
|
||||
("Signal4", "ES_LKAS_State", 0),
|
||||
("LKAS_Right_Line_Light_Blink", "ES_LKAS_State", 0),
|
||||
("LKAS_Left_Line_Visible", "ES_LKAS_State", 0),
|
||||
("Signal6", "ES_LKAS_State", 0),
|
||||
("LKAS_Left_Line_Green", "ES_LKAS_State", 0),
|
||||
("LKAS_Right_Line_Visible", "ES_LKAS_State", 0),
|
||||
("Signal7", "ES_LKAS_State", 0),
|
||||
("FCW_Cont_Beep", "ES_LKAS_State", 0),
|
||||
("FCW_Repeated_Beep", "ES_LKAS_State", 0),
|
||||
("Throttle_Management_Activated", "ES_LKAS_State", 0),
|
||||
("Traffic_light_Ahead", "ES_LKAS_State", 0),
|
||||
("Right_Depart", "ES_LKAS_State", 0),
|
||||
("Signal5", "ES_LKAS_State", 0),
|
||||
("LKAS_Right_Line_Green", "ES_LKAS_State", 0),
|
||||
("LKAS_Alert", "ES_LKAS_State", 0),
|
||||
("Signal3", "ES_LKAS_State", 0),
|
||||
]
|
||||
|
||||
checks = [
|
||||
("ES_DashStatus", 10),
|
||||
("ES_Distance", 20),
|
||||
("ES_LKAS_State", 10),
|
||||
]
|
||||
|
||||
return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, 2)
|
||||
|
|
|
@ -24,7 +24,7 @@ def create_es_distance(packer, es_distance_msg, pcm_cancel_cmd):
|
|||
|
||||
values = copy.copy(es_distance_msg)
|
||||
if pcm_cancel_cmd:
|
||||
values["Main"] = 1
|
||||
values["Cruise_Cancel"] = 1
|
||||
|
||||
return packer.make_can_msg("ES_Distance", 0, values)
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ ECU_FINGERPRINT = {
|
|||
}
|
||||
|
||||
DBC = {
|
||||
CAR.ASCENT: dbc_dict('subaru_global_2017', None),
|
||||
CAR.IMPREZA: dbc_dict('subaru_global_2017', None),
|
||||
CAR.FORESTER: dbc_dict('subaru_global_2017', None),
|
||||
CAR.ASCENT: dbc_dict('subaru_global_2017_generated', None),
|
||||
CAR.IMPREZA: dbc_dict('subaru_global_2017_generated', None),
|
||||
CAR.FORESTER: dbc_dict('subaru_global_2017_generated', None),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue