From e5da7cc04b75df4592b7c6f16ec649fa60e29ef0 Mon Sep 17 00:00:00 2001 From: HaraldSchafer Date: Thu, 7 Oct 2021 11:15:08 -0700 Subject: [PATCH] no throttle when not enabled (#22474) --- selfdrive/car/honda/carcontroller.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 8c63393a31..74b366fa2f 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -231,6 +231,10 @@ class CarController(): # send exactly zero if apply_gas is zero. Interceptor will send the max between read value and apply_gas. # This prevents unexpected pedal range rescaling apply_gas = clip(gas_mult * gas, 0., 1.) + if enabled: + apply_gas = clip(gas_mult * (gas - brake + wind_brake*3/4), 0., 1.) + else: + apply_gas = 0.0 can_sends.append(create_gas_command(self.packer, apply_gas, idx)) hud = HUDData(int(pcm_accel), int(round(hud_v_cruise)), hud_car,