simplify control_on

pull/25364/head
royjr 3 years ago
parent ac2062e5b9
commit 85dd33e6ac
  1. 6
      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,

Loading…
Cancel
Save