pull/26010/head
Shane Smiskol 3 years ago
parent 031de6d90b
commit c239468902
  1. 2
      selfdrive/car/gm/carcontroller.py
  2. 4
      selfdrive/car/gm/gmcan.py

@ -113,7 +113,7 @@ class CarController:
else: else:
# Silence "Take Steering" alert sent by camera, send PSCMStatus with HandsOffSWlDetectionStatus=1 # Silence "Take Steering" alert sent by camera, send PSCMStatus with HandsOffSWlDetectionStatus=1
if self.frame % 500 == 0: if self.frame % 500 == 0:
can_sends.append(gmcan.create_pscm_status(self.packer_pt, CS.pscm_status)) can_sends.append(gmcan.create_pscm_status(self.packer_pt, CS.pscm_status_counter))
# Stock longitudinal, integrated at camera # Stock longitudinal, integrated at camera
if (self.frame - self.last_button_frame) * DT_CTRL > 0.04: if (self.frame - self.last_button_frame) * DT_CTRL > 0.04:

@ -7,12 +7,12 @@ def create_buttons(packer, bus, idx, button):
} }
return packer.make_can_msg("ASCMSteeringButton", bus, values) return packer.make_can_msg("ASCMSteeringButton", bus, values)
def create_pscm_status(packer, pscm_status): def create_pscm_status(packer, idx):
values = { values = {
"HandsOffSWDetectionMode": 1, "HandsOffSWDetectionMode": 1,
"HandsOffSWlDetectionStatus": 1, "HandsOffSWlDetectionStatus": 1,
"LKATorqueDeliveredStatus": 0, "LKATorqueDeliveredStatus": 0,
"RollingCounter": int(pscm_status["RollingCounter"] + 1) & 0xf, "RollingCounter": int(idx + 1) & 0xf,
} }
values["PSCMStatusChecksum"] = (0x30 + (values['HandsOffSWlDetectionStatus'] << 5) + values["PSCMStatusChecksum"] = (0x30 + (values['HandsOffSWlDetectionStatus'] << 5) +
(values['LKATorqueDeliveredStatus'] << 3) + (values['LKATorqueDeliveredStatus'] << 3) +

Loading…
Cancel
Save