Revert "this makes it 2x more reliable, but messyyy"

This reverts commit 03401dc4a7.
pull/27164/head
Shane Smiskol 2 years ago
parent 03401dc4a7
commit 3f09cea3e7
  1. 6
      selfdrive/car/gm/carcontroller.py
  2. 2
      selfdrive/car/gm/carstate.py

@ -26,7 +26,6 @@ class CarController:
self.last_steer_frame = 0
self.last_button_frame = 0
self.cancel_counter = 0
self.send_on_frame = 0
self.lka_steering_cmd_counter = 0
self.sent_lka_steering_cmd = False
@ -54,11 +53,8 @@ class CarController:
init_lka_counter = not self.sent_lka_steering_cmd and self.CP.networkLocation == NetworkLocation.fwdCamera
# Send at 50Hz until we're sending right before camera sends LKAS message
out_of_sync = self.lka_steering_cmd_counter % 4 != (CS.camera_lka_steering_cmd_counter + 1) % 4
cam_updated = CS.camera_lka_steering_cmd_updated
if cam_updated:
self.send_on_frame = self.frame + 9 # this allows for 2x more restarts (~60) without faulting
steer_step = self.params.INACTIVE_STEER_STEP
if CC.latActive or init_lka_counter or out_of_sync or self.send_on_frame == self.frame:
if CC.latActive or init_lka_counter or out_of_sync:
steer_step = self.params.STEER_STEP
# Avoid GM EPS faults when transmitting messages too close together: skip this transmit if we just received the

@ -18,7 +18,6 @@ class CarState(CarStateBase):
can_define = CANDefine(DBC[CP.carFingerprint]["pt"])
self.shifter_values = can_define.dv["ECMPRDNL2"]["PRNDL2"]
self.loopback_lka_steering_cmd_updated = False
self.camera_lka_steering_cmd_updated = False
self.pt_lka_steering_cmd_counter = 0
self.camera_lka_steering_cmd_counter = 0
self.buttons_counter = 0
@ -34,7 +33,6 @@ class CarState(CarStateBase):
# Variables used for avoiding LKAS faults
self.loopback_lka_steering_cmd_updated = len(loopback_cp.vl_all["ASCMLKASteeringCmd"]["RollingCounter"]) > 0
self.camera_lka_steering_cmd_updated = len(cam_cp.vl_all["ASCMLKASteeringCmd"]["RollingCounter"]) > 0
if self.CP.networkLocation == NetworkLocation.fwdCamera:
self.pt_lka_steering_cmd_counter = pt_cp.vl["ASCMLKASteeringCmd"]["RollingCounter"]
self.camera_lka_steering_cmd_counter = cam_cp.vl["ASCMLKASteeringCmd"]["RollingCounter"]

Loading…
Cancel
Save