diff --git a/panda/board/safety/safety_volkswagen_pq.h b/panda/board/safety/safety_volkswagen_pq.h index 6933abc1746e20..2835c219badc76 100644 --- a/panda/board/safety/safety_volkswagen_pq.h +++ b/panda/board/safety/safety_volkswagen_pq.h @@ -37,14 +37,15 @@ const LongitudinalLimits VOLKSWAGEN_PQ_LONG_LIMITS_SPORT = { #define MSG_ACC_GRA_ANZEIGE 0x56A // TX by OP, ACC HUD #define MSG_LDW_1 0x5BE // TX by OP, Lane line recognition and text alerts #define MSG_PLA_1 0x3D4 // TX by OP, experimentation signal only +#define MSG_GK_1 0x38A // TX by OP, spamming reverse light ON. Testing EPS PLA entry not in R // Transmit of GRA_Neu is allowed on bus 0 and 2 to keep compatibility with gateway and camera integration const CanMsg VOLKSWAGEN_PQ_STOCK_TX_MSGS[] = {{MSG_HCA_1, 0, 5}, {MSG_LDW_1, 0, 8}, {MSG_GRA_NEU, 0, 4}, {MSG_GRA_NEU, 2, 4}, - {MSG_PLA_1, 1, 8}}; + {MSG_PLA_1, 1, 8}, {MSG_GK_1, 1, 8}}; const CanMsg VOLKSWAGEN_PQ_LONG_TX_MSGS[] = {{MSG_HCA_1, 0, 5}, {MSG_LDW_1, 0, 8}, {MSG_ACC_SYSTEM, 0, 8}, {MSG_ACC_GRA_ANZEIGE, 0, 8}, - {MSG_PLA_1, 1, 8}}; + {MSG_PLA_1, 1, 8}, {MSG_GK_1, 1, 8}}; RxCheck volkswagen_pq_rx_checks[] = { {.msg = {{MSG_LENKHILFE_3, 0, 6, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index 9a84dcfbc79d1d..badc46597f2408 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -97,10 +97,15 @@ def update(self, CC, CS, ext_bus, now_nanos, frogpilot_variables): 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)) + # **** Gate_Komf Spammer ************************************************ # + if CS.Gate_Komf_stock != 0: + can_sends.append(self.CCS.create_gk_spam(self.packer_pt, CANBUS.br, CS.Gate_Komf_stock)) + new_actuators = actuators.copy() new_actuators.steeringAngleDeg = self.apply_angle_last self.eps_timer_soft_disable_alert = False + CS.Gate_Komf_stock = 0 self.gra_acc_counter_last = CS.gra_stock_values["COUNTER"] self.frame += 1 diff --git a/selfdrive/car/volkswagen/carstate.py b/selfdrive/car/volkswagen/carstate.py index 556920e8a359a8..d79de766198847 100644 --- a/selfdrive/car/volkswagen/carstate.py +++ b/selfdrive/car/volkswagen/carstate.py @@ -184,6 +184,8 @@ def update_pq(self, pt_cp, cam_cp, ext_cp, trans_type, frogpilot_variables): ret.steerFaultTemporary = True if pt_cp.vl["Lenkhilfe_2"]["LH2_PLA_Abbr"] == 2 else False self.LH_3_Sign = pt_cp.vl["Lenkhilfe_3"]["LH3_BLWSign"] + self.Gate_Komf_stock = pt_cp.vl["Gate_Komf_1"] + # Update gas, brakes, and gearshift. ret.gas = pt_cp.vl["Motor_3"]["Fahrpedal_Rohsignal"] / 100.0 ret.gasPressed = ret.gas > 0 diff --git a/selfdrive/car/volkswagen/pqcan.py b/selfdrive/car/volkswagen/pqcan.py index 3b796e9aa78569..1842321a73645a 100644 --- a/selfdrive/car/volkswagen/pqcan.py +++ b/selfdrive/car/volkswagen/pqcan.py @@ -49,6 +49,14 @@ def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resu return packer.make_can_msg("GRA_Neu", bus, values) +def create_gk_spam(packer, bus, gk_stock): + values = gk_stock + values.update({ + "GK1_Rueckfahr": 1, + }) + + return packer.make_can_msg("Gate_Komf_1", bus, values) + def acc_control_value(main_switch_on, acc_faulted, long_active, cruiseOverride): if long_active or cruiseOverride: acc_control = 1