From 3f09cea3e7ff6be7d3eb5a03ea078e317cad052b Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 31 Jan 2023 16:58:20 -0800 Subject: [PATCH] Revert "this makes it 2x more reliable, but messyyy" This reverts commit 03401dc4a705cfacbe5a7048d95dccb6fa80d57f. --- selfdrive/car/gm/carcontroller.py | 6 +----- selfdrive/car/gm/carstate.py | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index 9b1ef90ae4..dd6be0d084 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.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 diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index c56f9bdb44..8ea8ea8874 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -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"]