From 85dd33e6ace74aa99638f1625af46dd79e1223cd Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 14 Dec 2022 12:18:40 -0500 Subject: [PATCH] simplify control_on --- selfdrive/car/honda/hondacan.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py index a3fb71abf9..e9a3cb0f80 100644 --- a/selfdrive/car/honda/hondacan.py +++ b/selfdrive/car/honda/hondacan.py @@ -51,7 +51,6 @@ def create_acc_commands(packer, enabled, active, accel, gas, stopping, car_finge bus = get_pt_bus(car_fingerprint) min_gas_accel = CarControllerParams.BOSCH_GAS_LOOKUP_BP[0] - control_on = 5 if enabled else 0 gas_command = gas if active and accel > min_gas_accel else -30000 accel_command = accel if active else 0 braking = 1 if active and accel < min_gas_accel else 0 @@ -59,9 +58,8 @@ def create_acc_commands(packer, enabled, active, accel, gas, stopping, car_finge standstill_release = 1 if active and not stopping else 0 if car_fingerprint in HONDA_BOSCH_RADARLESS: - control_on = 1 if enabled else 0 acc_control_values = { - "CONTROL_ON": control_on, + "CONTROL_ON": 1 if enabled else 0, "CONTROL_OFF": 1, # TODO: not sure this signal is needed "ACCEL_COMMAND": accel_command, "STANDSTILL": standstill, @@ -69,7 +67,7 @@ def create_acc_commands(packer, enabled, active, accel, gas, stopping, car_finge else: acc_control_values = { # setting CONTROL_ON causes car to set POWERTRAIN_DATA->ACC_STATUS = 1 - "CONTROL_ON": control_on, + "CONTROL_ON": 5 if enabled else 0, "GAS_COMMAND": gas_command, # used for gas "ACCEL_COMMAND": accel_command, # used for brakes "BRAKE_LIGHTS": braking,