Skip to content

Commit

Permalink
permit braking uses final acceleration request
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Oct 5, 2024
1 parent 000cc24 commit bf585e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opendbc/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ def update(self, CC, CS, now_nanos):

# Along with rate limiting positive jerk below, this greatly improves gas response time
# Consider the net acceleration request that the PCM should be applying (pitch included)
if net_acceleration_request < 0.1:
if pcm_accel_cmd + accel_due_to_pitch < 0.1:
self.permit_braking = True
elif net_acceleration_request > 0.2:
elif pcm_accel_cmd + accel_due_to_pitch > 0.2:
self.permit_braking = False
else:
self.pcm_accel_compensation = 0.0
Expand Down

0 comments on commit bf585e1

Please sign in to comment.