VW: Explicit signal pass-through (#28179)

* VW: Explicit signal copy

* normalize whitespace
old-commit-hash: f951390dda
beeps
Jason Young 2 years ago committed by GitHub
parent 532828bd15
commit 448c80ed07
  1. 3
      selfdrive/car/volkswagen/carcontroller.py
  2. 28
      selfdrive/car/volkswagen/mqbcan.py
  3. 29
      selfdrive/car/volkswagen/pqcan.py

@ -101,8 +101,7 @@ class CarController:
gra_send_ready = self.CP.pcmCruise and CS.gra_stock_values["COUNTER"] != self.gra_acc_counter_last
if gra_send_ready and (CC.cruiseControl.cancel or CC.cruiseControl.resume):
counter = (CS.gra_stock_values["COUNTER"] + 1) % 16
can_sends.append(self.CCS.create_acc_buttons_control(self.packer_pt, ext_bus, CS.gra_stock_values, counter,
can_sends.append(self.CCS.create_acc_buttons_control(self.packer_pt, ext_bus, CS.gra_stock_values,
cancel=CC.cruiseControl.cancel, resume=CC.cruiseControl.resume))
new_actuators = actuators.copy()

@ -11,7 +11,15 @@ def create_steering_control(packer, bus, apply_steer, lkas_enabled):
def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pressed, hud_alert, hud_control):
values = ldw_stock_values.copy()
values = {}
if len(ldw_stock_values):
values = {s: ldw_stock_values[s] for s in [
"LDW_SW_Warnung_links", # Blind spot in warning mode on left side due to lane departure
"LDW_SW_Warnung_rechts", # Blind spot in warning mode on right side due to lane departure
"LDW_Seite_DLCTLC", # Direction of most likely lane departure (left or right)
"LDW_DLC", # Lane departure, distance to line crossing
"LDW_TLC", # Lane departure, time to line crossing
]}
values.update({
"LDW_Status_LED_gelb": 1 if enabled and steering_pressed else 0,
@ -23,11 +31,23 @@ def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pres
return packer.make_can_msg("LDW_02", bus, values)
def create_acc_buttons_control(packer, bus, gra_stock_values, counter, cancel=False, resume=False):
values = gra_stock_values.copy()
def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resume=False):
values = {s: gra_stock_values[s] for s in [
"GRA_Hauptschalter", # ACC button, on/off
"GRA_Abbrechen", # ACC button, cancel
"GRA_Tip_Setzen", # ACC button, set
"GRA_Tip_Hoch", # ACC button, increase or accel
"GRA_Tip_Runter", # ACC button, decrease or decel
"GRA_Tip_Wiederaufnahme", # ACC button, resume
"GRA_Verstellung_Zeitluecke", # ACC button, time gap adj
"GRA_Typ_Hauptschalter", # ACC main button type
"GRA_Codierung", # ACC button configuration/coding
"GRA_Tip_Stufe_2", # unknown related to stalk type
"GRA_ButtonTypeInfo", # unknown related to stalk type
]}
values.update({
"COUNTER": counter,
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16,
"GRA_Abbrechen": cancel,
"GRA_Tip_Wiederaufnahme": resume,
})

@ -10,7 +10,15 @@ def create_steering_control(packer, bus, apply_steer, lkas_enabled):
def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pressed, hud_alert, hud_control):
values = ldw_stock_values.copy()
values = {}
if len(ldw_stock_values):
values = {s: ldw_stock_values[s] for s in [
"LDW_SW_Warnung_links", # Blind spot in warning mode on left side due to lane departure
"LDW_SW_Warnung_rechts", # Blind spot in warning mode on right side due to lane departure
"LDW_Seite_DLCTLC", # Direction of most likely lane departure (left or right)
"LDW_DLC", # Lane departure, distance to line crossing
"LDW_TLC", # Lane departure, time to line crossing
]}
values.update({
"LDW_Lampe_gelb": 1 if enabled and steering_pressed else 0,
@ -23,11 +31,24 @@ def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pres
return packer.make_can_msg("LDW_Status", bus, values)
def create_acc_buttons_control(packer, bus, gra_stock_values, counter, cancel=False, resume=False):
values = gra_stock_values.copy()
def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resume=False):
values = {s: gra_stock_values[s] for s in [
"GRA_Hauptschalt", # ACC button, on/off
"GRA_Typ_Hauptschalt", # ACC button, momentary vs latching
"GRA_Kodierinfo", # ACC button, configuration
"GRA_Abbrechen", # ACC button, cancel
"GRA_Neu_Setzen", # ACC button, set
"GRA_Up_lang", # ACC button, increase or accel, long press
"GRA_Down_lang", # ACC button, decrease or decel, long press
"GRA_Up_kurz", # ACC button, increase or accel, short press
"GRA_Down_kurz", # ACC button, decrease or decel, short press
"GRA_Recall", # ACC button, resume
"GRA_Zeitluecke", # ACC button, time gap adj
"GRA_Sender", # ACC button, CAN message originator
]}
values.update({
"COUNTER": counter,
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16,
"GRA_Abbrechen": cancel,
"GRA_Recall": resume,
})

Loading…
Cancel
Save