Fix new steer saturated warning with joystick mode (#25113)

Fix steer sat warning with joystick mode
old-commit-hash: be7f704168
taco
Shane Smiskol 3 years ago committed by GitHub
parent 8ca0e9b941
commit 493d6ef693
  1. 4
      selfdrive/controls/controlsd.py

@ -602,14 +602,14 @@ class Controls:
lac_log.saturated = abs(actuators.steer) >= 0.9 lac_log.saturated = abs(actuators.steer) >= 0.9
# Send a "steering required alert" if saturation count has reached the limit # Send a "steering required alert" if saturation count has reached the limit
if lac_log.active and not CS.steeringPressed and self.CP.lateralTuning.which() == 'torque': if lac_log.active and not CS.steeringPressed and self.CP.lateralTuning.which() == 'torque' and not self.joystick_mode:
undershooting = abs(lac_log.desiredLateralAccel) / abs(1e-3 + lac_log.actualLateralAccel) > 1.2 undershooting = abs(lac_log.desiredLateralAccel) / abs(1e-3 + lac_log.actualLateralAccel) > 1.2
turning = abs(lac_log.desiredLateralAccel) > 1.0 turning = abs(lac_log.desiredLateralAccel) > 1.0
good_speed = CS.vEgo > 5 good_speed = CS.vEgo > 5
max_torque = abs(self.last_actuators.steer) > 0.99 max_torque = abs(self.last_actuators.steer) > 0.99
if undershooting and turning and good_speed and max_torque: if undershooting and turning and good_speed and max_torque:
self.events.add(EventName.steerSaturated) self.events.add(EventName.steerSaturated)
elif lac_log.active and lac_log.saturated and not CS.steeringPressed: elif lac_log.active and not CS.steeringPressed and lac_log.saturated:
dpath_points = lat_plan.dPathPoints dpath_points = lat_plan.dPathPoints
if len(dpath_points): if len(dpath_points):
# Check if we deviated from the path # Check if we deviated from the path

Loading…
Cancel
Save