|
|
|
@ -50,13 +50,14 @@ class CarController: |
|
|
|
|
|
|
|
|
|
# Steering (Active: 50Hz, inactive: 10Hz) |
|
|
|
|
# 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 |
|
|
|
|
init_lka_counter = not self.sent_lka_steering_cmd |
|
|
|
|
# Also send at 50Hz until we're in sync with camera so counters align when relay closes, preventing a fault |
|
|
|
|
# openpilot can subtly drift, so this is activated throughout a drive to stay synced |
|
|
|
|
out_of_sync = self.lka_steering_cmd_counter % 4 != (CS.camera_lka_steering_cmd_counter + 1) % 4 |
|
|
|
|
sync_steer = (init_lka_counter or out_of_sync) and self.CP.networkLocation == NetworkLocation.fwdCamera |
|
|
|
|
|
|
|
|
|
steer_step = self.params.INACTIVE_STEER_STEP |
|
|
|
|
if CC.latActive or init_lka_counter or out_of_sync: |
|
|
|
|
if CC.latActive or sync_steer: |
|
|
|
|
steer_step = self.params.STEER_STEP |
|
|
|
|
|
|
|
|
|
# Avoid GM EPS faults when transmitting messages too close together: skip this transmit if we just received the |
|
|
|
|