Skip to content

Commit

Permalink
feat: Prevent car to go on steering fault when user steering rate is …
Browse files Browse the repository at this point in the history
…high.
  • Loading branch information
alfhern committed Oct 11, 2024
1 parent 7f68712 commit b4bda8a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions selfdrive/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ def update(self, CC, CS, now_nanos):
apply_steer = apply_meas_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, self.CCP)

# Count up to MAX_STEER_RATE_FRAMES, at which point we need to cut torque to avoid a steering fault.
# We do not do this when in External Control Mode so that car safety is persistent after user takes control
if lat_active and not self.CCP.externalControlMode and abs(CS.out.steeringRateDeg) >= MAX_STEER_RATE:
if lat_active and abs(CS.out.steeringRateDeg) >= MAX_STEER_RATE:
self.steer_rate_counter += 1
else:
self.steer_rate_counter = 0
Expand Down

0 comments on commit b4bda8a

Please sign in to comment.