From 7407622959b8820055e0fef4ea5443dffb1e37f8 Mon Sep 17 00:00:00 2001 From: Jason Young Date: Tue, 13 Sep 2022 22:00:44 -0400 Subject: [PATCH] more cleanup --- selfdrive/car/volkswagen/carcontroller.py | 2 +- selfdrive/car/volkswagen/mqbcan.py | 7 ++----- selfdrive/car/volkswagen/pqcan.py | 6 +++++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index 4db3e5992..b6734c9a3 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -89,7 +89,7 @@ class CarController: 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) 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 **************************************** # diff --git a/selfdrive/car/volkswagen/mqbcan.py b/selfdrive/car/volkswagen/mqbcan.py index 30b1dbd7f..f1dae7e59 100644 --- a/selfdrive/car/volkswagen/mqbcan.py +++ b/selfdrive/car/volkswagen/mqbcan.py @@ -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): - commands = [] - - acc_02_values = { + values = { "ACC_Status_Anzeige": acc_hud_status, "ACC_Wunschgeschw": set_speed if set_speed < 250 else 327.36, "ACC_Gesetzte_Zeitluecke": 3, "ACC_Display_Prio": 3, # 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) diff --git a/selfdrive/car/volkswagen/pqcan.py b/selfdrive/car/volkswagen/pqcan.py index 8adcdfa58..c7e9233a5 100644 --- a/selfdrive/car/volkswagen/pqcan.py +++ b/selfdrive/car/volkswagen/pqcan.py @@ -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): + commands = [] + values = { "ACS_Sta_ADR": acc_status, "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, } - 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):