Skip to content

Commit

Permalink
init gk_1 spam
Browse files Browse the repository at this point in the history
  • Loading branch information
dkiiv committed Jul 27, 2024
1 parent 4892451 commit 5719af7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions panda/board/safety/safety_volkswagen_pq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

This comment has been minimized.

Copy link
@FLcruising

FLcruising Aug 1, 2024

This ID is wrong. (0x38A is GRA_Neu)
Should be 0x390


// 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 }}},
Expand Down
5 changes: 5 additions & 0 deletions selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions selfdrive/car/volkswagen/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions selfdrive/car/volkswagen/pqcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5719af7

Please sign in to comment.