|
|
@ -5,7 +5,7 @@ from common.realtime import DT_CTRL |
|
|
|
from opendbc.can.packer import CANPacker |
|
|
|
from opendbc.can.packer import CANPacker |
|
|
|
from selfdrive.car import apply_std_steer_torque_limits |
|
|
|
from selfdrive.car import apply_std_steer_torque_limits |
|
|
|
from selfdrive.car.gm import gmcan |
|
|
|
from selfdrive.car.gm import gmcan |
|
|
|
from selfdrive.car.gm.values import DBC, CanBus, CarControllerParams, EV_CAR |
|
|
|
from selfdrive.car.gm.values import DBC, CanBus, CarControllerParams, CruiseButtons, EV_CAR |
|
|
|
|
|
|
|
|
|
|
|
VisualAlert = car.CarControl.HUDControl.VisualAlert |
|
|
|
VisualAlert = car.CarControl.HUDControl.VisualAlert |
|
|
|
NetworkLocation = car.CarParams.NetworkLocation |
|
|
|
NetworkLocation = car.CarParams.NetworkLocation |
|
|
@ -107,6 +107,14 @@ class CarController: |
|
|
|
if self.CP.networkLocation == NetworkLocation.gateway and self.frame % self.params.ADAS_KEEPALIVE_STEP == 0: |
|
|
|
if self.CP.networkLocation == NetworkLocation.gateway and self.frame % self.params.ADAS_KEEPALIVE_STEP == 0: |
|
|
|
can_sends += gmcan.create_adas_keepalive(CanBus.POWERTRAIN) |
|
|
|
can_sends += gmcan.create_adas_keepalive(CanBus.POWERTRAIN) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif self.CP.networkLocation == NetworkLocation.fwdCamera: |
|
|
|
|
|
|
|
# Stock longitudinal, integrated at camera |
|
|
|
|
|
|
|
if self.frame % 3 == 0: |
|
|
|
|
|
|
|
if CC.cruiseControl.cancel: |
|
|
|
|
|
|
|
can_sends.append(gmcan.create_buttons(self.packer_pt, CruiseButtons.CANCEL)) |
|
|
|
|
|
|
|
elif CC.cruiseControl.resume: |
|
|
|
|
|
|
|
can_sends.append(gmcan.create_buttons(self.packer_pt, CruiseButtons.RES_ACCEL)) |
|
|
|
|
|
|
|
|
|
|
|
# Show green icon when LKA torque is applied, and |
|
|
|
# Show green icon when LKA torque is applied, and |
|
|
|
# alarming orange icon when approaching torque limit. |
|
|
|
# alarming orange icon when approaching torque limit. |
|
|
|
# If not sent again, LKA icon disappears in about 5 seconds. |
|
|
|
# If not sent again, LKA icon disappears in about 5 seconds. |
|
|
|