From 0f7d479f85cca82a772001aaa01b343ad0542280 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 30 Jan 2023 22:44:19 -0800 Subject: [PATCH] Reliable relay close --- selfdrive/car/gm/carcontroller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index c5aae34249..2711b7bebc 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -48,11 +48,12 @@ class CarController: # Send CAN commands. can_sends = [] - # Steering (Active: 50Hz, inactive: 10Hz) + # Steering (50Hz: active, syncing with camera, 10Hz: inactive) # Attempt to sync with camera on startup at 50Hz, first few msgs are blocked init_lka_counter = not self.sent_lka_steering_cmd and self.CP.networkLocation == NetworkLocation.fwdCamera + out_of_sync = self.lka_steering_cmd_counter % 4 != (CS.camera_lka_steering_cmd_counter + 1) % 4 steer_step = self.params.INACTIVE_STEER_STEP - if CC.latActive or init_lka_counter: + 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