Skip to content

Commit 637d11e

Browse files
authored
fix
1 parent cad8ea8 commit 637d11e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

selfdrive/controls/lib/latcontrol_model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,19 @@ def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature,
5555
model_input = [angle_steers_des, CS.steeringAngleDeg, rate_des, rate, CS.vEgo]
5656

5757
output_steer = self.predict(model_input)[0]
58-
output_steer = clip(output_steer, -self.steer_max, self.steer_max)
5958
output_steer = float(output_steer * CP.lateralTuning.model.multiplier)
6059

6160
if output_steer < 0: # model doesn't like right curves
6261
_90_degree_bp = interp(CS.vEgo, [17.8816, 31.2928], [1., 1.1]) # 40 to 70 mph, 90 degree brakepoint
6362
multiplier = interp(abs(CS.steeringAngleDeg), [0, 90.], [1.27, _90_degree_bp])
6463
output_steer = float(output_steer * multiplier)
6564

65+
output_steer = clip(output_steer, -self.steer_max, self.steer_max)
66+
6667
model_log.active = True
6768
model_log.output = output_steer
6869

6970
check_saturation = (CS.vEgo > 10) and not CS.steeringRateLimited and not CS.steeringPressed
70-
model_log.saturated = self._check_saturation(output_steer, check_saturation, self.steer_max)
71+
model_log.saturated = pself._check_saturation(self.steer_max - abs(output_steer) < 1e-3, CS)
7172

7273
return output_steer, angle_steers_des, model_log

0 commit comments

Comments
 (0)