comma pedal: rename create_gas_command -> create_gas_interceptor_command

old-commit-hash: b07ddad6ed
commatwo_master
Adeeb Shihadeh 4 years ago
parent be1f80810e
commit 5e6608b67e
  1. 2
      selfdrive/car/__init__.py
  2. 4
      selfdrive/car/honda/carcontroller.py
  3. 4
      selfdrive/car/toyota/carcontroller.py

@ -99,7 +99,7 @@ def crc8_pedal(data):
return crc return crc
def create_gas_command(packer, gas_amount, idx): def create_gas_interceptor_command(packer, gas_amount, idx):
# Common gas pedal msg generator # Common gas pedal msg generator
enable = gas_amount > 0.001 enable = gas_amount > 0.001

@ -3,7 +3,7 @@ from cereal import car
from common.realtime import DT_CTRL from common.realtime import DT_CTRL
from selfdrive.controls.lib.drive_helpers import rate_limit from selfdrive.controls.lib.drive_helpers import rate_limit
from common.numpy_fast import clip, interp 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 import hondacan
from selfdrive.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams from selfdrive.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams
from opendbc.can.packer import CANPacker 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.) apply_gas = clip(gas_mult * (gas - brake + wind_brake*3/4), 0., 1.)
else: else:
apply_gas = 0.0 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 = HUDData(int(pcm_accel), int(round(hud_v_cruise)), hud_car,
hud_lanes, fcw_display, acc_alert, steer_required) hud_lanes, fcw_display, acc_alert, steer_required)

@ -1,6 +1,6 @@
from cereal import car from cereal import car
from common.numpy_fast import clip, interp 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, \ from selfdrive.car.toyota.toyotacan import create_steer_command, create_ui_command, \
create_accel_command, create_acc_cancel_command, \ create_accel_command, create_acc_cancel_command, \
create_fcw_command, create_lta_steer_command create_fcw_command, create_lta_steer_command
@ -123,7 +123,7 @@ class CarController():
if frame % 2 == 0 and CS.CP.enableGasInterceptor: 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. # 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 # 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: # ui mesg is at 100Hz but we send asap if:
# - there is something to display # - there is something to display

Loading…
Cancel
Save