this may be required, 50Hz is not really needed to sync/initialize

pull/26196/head
Shane Smiskol 3 years ago
parent 92a805b734
commit a6b4693814
  1. 9
      selfdrive/car/gm/carcontroller.py
  2. 1
      selfdrive/car/gm/values.py

@ -48,9 +48,12 @@ class CarController:
can_sends = [] can_sends = []
# Steering (Active: 50Hz, inactive: 10Hz) # Steering (Active: 50Hz, inactive: 10Hz)
# Attempt to sync with camera on startup at 50Hz, first few msgs are blocked # Attempt to sync with camera on startup at 25Hz, first few msgs are blocked
steer_step = self.params.INACTIVE_STEER_STEP if not self.sent_lka_steering_cmd:
if CC.latActive or not self.sent_lka_steering_cmd: steer_step = self.params.STARTUP_STEER_STEP
elif not CC.latActive:
steer_step = self.params.INACTIVE_STEER_STEP
else:
steer_step = self.params.ACTIVE_STEER_STEP steer_step = self.params.ACTIVE_STEER_STEP
# Avoid GM EPS faults when transmitting messages too close together: skip this transmit if we just received the # Avoid GM EPS faults when transmitting messages too close together: skip this transmit if we just received the

@ -13,6 +13,7 @@ class CarControllerParams:
STEER_MAX = 300 # GM limit is 3Nm. Used by carcontroller to generate LKA output STEER_MAX = 300 # GM limit is 3Nm. Used by carcontroller to generate LKA output
ACTIVE_STEER_STEP = 2 # Control frames per command (50hz) ACTIVE_STEER_STEP = 2 # Control frames per command (50hz)
INACTIVE_STEER_STEP = 10 # Control frames per command (10hz) INACTIVE_STEER_STEP = 10 # Control frames per command (10hz)
STARTUP_STEER_STEP = 4 # Control frames per command (25hz)
STEER_DELTA_UP = 7 # Delta rates require review due to observed EPS weakness STEER_DELTA_UP = 7 # Delta rates require review due to observed EPS weakness
STEER_DELTA_DOWN = 17 STEER_DELTA_DOWN = 17
STEER_DRIVER_ALLOWANCE = 50 STEER_DRIVER_ALLOWANCE = 50

Loading…
Cancel
Save