Toyota: PERMIT_BRAKING shouldn't use rate limited decel (#1495)

fix permit braking being set late with step brake response
This commit is contained in:
Shane Smiskol 2024-11-15 22:18:34 -06:00 committed by GitHub
parent 38c867912a
commit c10cd4f5ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -203,9 +203,10 @@ class CarController(CarControllerBase):
# Along with rate limiting positive jerk above, 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 or stopping or not CC.longActive:
net_acceleration_request_min = min(actuators.accel + accel_due_to_pitch, net_acceleration_request)
if net_acceleration_request_min < 0.1 or stopping or not CC.longActive:
self.permit_braking = True
elif net_acceleration_request > 0.2:
elif net_acceleration_request_min > 0.2:
self.permit_braking = False
pcm_accel_cmd = clip(pcm_accel_cmd, self.params.ACCEL_MIN, self.params.ACCEL_MAX)