From 5e6608b67e70ef5ef659b3fc04003faf1dab8de0 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 20 Nov 2021 20:13:05 -0800 Subject: [PATCH] comma pedal: rename create_gas_command -> create_gas_interceptor_command old-commit-hash: b07ddad6ed62f9b0002ce7aa73db932dd2d7a73e --- selfdrive/car/__init__.py | 2 +- selfdrive/car/honda/carcontroller.py | 4 ++-- selfdrive/car/toyota/carcontroller.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py index ddb20fe549..408e0d075f 100644 --- a/selfdrive/car/__init__.py +++ b/selfdrive/car/__init__.py @@ -99,7 +99,7 @@ def crc8_pedal(data): return crc -def create_gas_command(packer, gas_amount, idx): +def create_gas_interceptor_command(packer, gas_amount, idx): # Common gas pedal msg generator enable = gas_amount > 0.001 diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 1e0a35fdf5..d75be7c712 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -3,7 +3,7 @@ from cereal import car from common.realtime import DT_CTRL from selfdrive.controls.lib.drive_helpers import rate_limit from common.numpy_fast import clip, interp -from selfdrive.car import create_gas_command +from selfdrive.car import create_gas_interceptor_command from selfdrive.car.honda import hondacan from selfdrive.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams from opendbc.can.packer import CANPacker @@ -236,7 +236,7 @@ class CarController(): 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)) + can_sends.append(create_gas_interceptor_command(self.packer, apply_gas, idx)) hud = HUDData(int(pcm_accel), int(round(hud_v_cruise)), hud_car, hud_lanes, fcw_display, acc_alert, steer_required) diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index daf91a49d3..72cde0e537 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -1,6 +1,6 @@ from cereal import car from common.numpy_fast import clip, interp -from selfdrive.car import apply_toyota_steer_torque_limits, create_gas_command, make_can_msg +from selfdrive.car import apply_toyota_steer_torque_limits, create_gas_interceptor_command, make_can_msg from selfdrive.car.toyota.toyotacan import create_steer_command, create_ui_command, \ create_accel_command, create_acc_cancel_command, \ create_fcw_command, create_lta_steer_command @@ -123,7 +123,7 @@ class CarController(): if frame % 2 == 0 and CS.CP.enableGasInterceptor: # send exactly zero if gas cmd is zero. Interceptor will send the max between read value and gas cmd. # This prevents unexpected pedal range rescaling - can_sends.append(create_gas_command(self.packer, interceptor_gas_cmd, frame // 2)) + can_sends.append(create_gas_interceptor_command(self.packer, interceptor_gas_cmd, frame // 2)) # ui mesg is at 100Hz but we send asap if: # - there is something to display