more cleanup

mqb-long
Jason Young 3 years ago
parent 6c4a8e2838
commit 7407622959
  1. 2
      selfdrive/car/volkswagen/carcontroller.py
  2. 7
      selfdrive/car/volkswagen/mqbcan.py
  3. 6
      selfdrive/car/volkswagen/pqcan.py

@ -89,7 +89,7 @@ class CarController:
if self.frame % self.CCP.ACC_HUD_STEP == 0 and self.CP.openpilotLongitudinalControl: if self.frame % self.CCP.ACC_HUD_STEP == 0 and self.CP.openpilotLongitudinalControl:
acc_hud_status = self.CCS.acc_hud_status_value(CS.out.cruiseState.available, CS.out.accFaulted, CC.longActive) acc_hud_status = self.CCS.acc_hud_status_value(CS.out.cruiseState.available, CS.out.accFaulted, CC.longActive)
set_speed = hud_control.setSpeed * CV.MS_TO_KPH # FIXME: follow the recent displayed-speed updates, also use mph_kmh toggle to fix display rounding problem? set_speed = hud_control.setSpeed * CV.MS_TO_KPH # FIXME: follow the recent displayed-speed updates, also use mph_kmh toggle to fix display rounding problem?
can_sends.extend(self.CCS.create_acc_hud_control(self.packer_pt, CANBUS.pt, acc_hud_status, set_speed)) can_sends.append(self.CCS.create_acc_hud_control(self.packer_pt, CANBUS.pt, acc_hud_status, set_speed))
# **** Stock ACC Button Controls **************************************** # # **** Stock ACC Button Controls **************************************** #

@ -105,15 +105,12 @@ def create_acc_accel_control(packer, bus, acc_type, enabled, accel, acc_status,
def create_acc_hud_control(packer, bus, acc_hud_status, set_speed): def create_acc_hud_control(packer, bus, acc_hud_status, set_speed):
commands = [] values = {
acc_02_values = {
"ACC_Status_Anzeige": acc_hud_status, "ACC_Status_Anzeige": acc_hud_status,
"ACC_Wunschgeschw": set_speed if set_speed < 250 else 327.36, "ACC_Wunschgeschw": set_speed if set_speed < 250 else 327.36,
"ACC_Gesetzte_Zeitluecke": 3, "ACC_Gesetzte_Zeitluecke": 3,
"ACC_Display_Prio": 3, "ACC_Display_Prio": 3,
# TODO: ACC_Abstandsindex for lead car distance, must determine analog vs digital cluster for scaling # TODO: ACC_Abstandsindex for lead car distance, must determine analog vs digital cluster for scaling
} }
commands.append(packer.make_can_msg("ACC_02", bus, acc_02_values))
return commands return packer.make_can_msg("ACC_02", bus, values)

@ -60,6 +60,8 @@ def acc_hud_status_value(main_switch_on, acc_faulted, long_active):
def create_acc_accel_control(packer, bus, acc_type, enabled, accel, acc_status, stopping, starting, standstill): def create_acc_accel_control(packer, bus, acc_type, enabled, accel, acc_status, stopping, starting, standstill):
commands = []
values = { values = {
"ACS_Sta_ADR": acc_status, "ACS_Sta_ADR": acc_status,
"ACS_StSt_Info": acc_status != 1, "ACS_StSt_Info": acc_status != 1,
@ -69,7 +71,9 @@ def create_acc_accel_control(packer, bus, acc_type, enabled, accel, acc_status,
"ACS_max_AendGrad": 3.0 if acc_status == 1 else 5.08, "ACS_max_AendGrad": 3.0 if acc_status == 1 else 5.08,
} }
packer.make_can_msg("ACC_System", bus, values) commands.append(packer.make_can_msg("ACC_System", bus, values))
return commands
def create_acc_hud_control(packer, bus, acc_hud_status, set_speed): def create_acc_hud_control(packer, bus, acc_hud_status, set_speed):

Loading…
Cancel
Save