send at 10hz when inactive

pull/26196/head
Shane Smiskol 3 years ago
parent 0edbbdeaf9
commit cdabc1d9a5
  1. 3
      selfdrive/car/gm/carcontroller.py
  2. 3
      selfdrive/car/gm/values.py

@ -45,10 +45,11 @@ class CarController:
# Steering (50Hz) # Steering (50Hz)
# 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
# next Panda loopback confirmation in the current CS frame. # next Panda loopback confirmation in the current CS frame.
steer_step = self.params.ACTIVE_STEER_STEP if CC.latActive else self.params.INACTIVE_STEER_STEP
if CS.loopback_lka_steering_cmd_updated: if CS.loopback_lka_steering_cmd_updated:
self.lka_steering_cmd_counter += 1 self.lka_steering_cmd_counter += 1
self.sent_lka_steering_cmd = True self.sent_lka_steering_cmd = True
elif (self.frame % self.params.STEER_STEP) == 0: elif (self.frame % steer_step) == 0:
# Initialize ASCMLKASteeringCmd counter using the camera # Initialize ASCMLKASteeringCmd counter using the camera
if not self.sent_lka_steering_cmd and self.CP.networkLocation == NetworkLocation.fwdCamera: if not self.sent_lka_steering_cmd and self.CP.networkLocation == NetworkLocation.fwdCamera:
self.lka_steering_cmd_counter = CS.camera_lka_steering_cmd_counter + 1 self.lka_steering_cmd_counter = CS.camera_lka_steering_cmd_counter + 1

@ -11,7 +11,8 @@ Ecu = car.CarParams.Ecu
class CarControllerParams: 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
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)
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