Skip to content

Commit

Permalink
VW PQ: refining ECD
Browse files Browse the repository at this point in the history
* restore cruiseState.available
* improve cruiseState.enabled
* bump DBC for comma pedal prep
  • Loading branch information
dkiiv committed Nov 3, 2024
1 parent c21c4e7 commit c67cb4d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion opendbc_repo
1 change: 1 addition & 0 deletions selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def update(self, CC, CS, now_nanos):
self.EPB_brake = clip(actuators.accel, self.CCP.ACCEL_MIN, 0)
else:
accel = clip(actuators.accel, self.CCP.ACCEL_MIN, self.CCP.ACCEL_MAX) if CC.longActive else 0
acc_control = 0 if self.EPB_enable and CC.longActive else acc_control
self.EPB_enable = 0
self.EPB_brake = 0
self.long_deviation = 0 # TODO: make dynamic again
Expand Down
5 changes: 3 additions & 2 deletions selfdrive/car/volkswagen/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ def update_pq(self, pt_cp, cam_cp, ext_cp, trans_type):

# Update ACC radar status.
self.acc_type = ext_cp.vl["ACC_System"]["ACS_Typ_ACC"]
ret.cruiseState.available = True # TODO: fix this, ECD cancels ECM cruise but we still want to be engaged!
ret.cruiseState.enabled = pt_cp.vl["Motor_2"]["GRA_Status"] in (1, 2)
ret.cruiseState.available = bool(pt_cp.vl["Motor_5"]["GRA_Hauptschalter"])
ret.cruiseState.enabled = pt_cp.vl["Motor_2"]["GRA_Status"] in (1, 2) or bool(pt_cp.vl["Bremse_8"]["BR8_Verz_EPB_akt"])
if self.CP.pcmCruise:
ret.accFaulted = ext_cp.vl["ACC_GRA_Anzeige"]["ACA_StaACC"] in (6, 7)
else:
Expand Down Expand Up @@ -354,6 +354,7 @@ def get_can_parser_pq(CP):
("Motor_3", 100), # From J623 Engine control module
("Airbag_1", 50), # From J234 Airbag control module
("Bremse_5", 50), # From J104 ABS/ESP controller
("Bremse_8", 50), # From J104 ABS/ESP controller
("GRA_Neu", 50), # From J??? steering wheel control buttons
("Kombi_1", 50), # From J285 Instrument cluster
("Motor_2", 50), # From J623 Engine control module
Expand Down

0 comments on commit c67cb4d

Please sign in to comment.