hard honda max accel in car interface (#21585)

* hard set in car interface, not related to planning

* move to values
pull/21601/head
HaraldSchafer 2021-07-14 11:06:29 -07:00 committed by GitHub
parent 5d07819084
commit b8a4adfb2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -5,10 +5,9 @@ from panda import Panda
from common.numpy_fast import clip, interp
from common.params import Params
from selfdrive.config import Conversions as CV
from selfdrive.car.honda.values import CruiseButtons, CAR, HONDA_BOSCH, HONDA_BOSCH_ALT_BRAKE_SIGNAL
from selfdrive.car.honda.values import CarControllerParams, CruiseButtons, CAR, HONDA_BOSCH, HONDA_BOSCH_ALT_BRAKE_SIGNAL
from selfdrive.car.honda.hondacan import disable_radar
from selfdrive.car import STD_CARGO_KG, CivicParams, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint
from selfdrive.controls.lib.longitudinal_planner import A_CRUISE_MAX_VALS
from selfdrive.car.interfaces import CarInterfaceBase
@ -120,7 +119,7 @@ class CarInterface(CarInterfaceBase):
# accelOverride is more or less the max throttle allowed to pcm: usually set to a constant
# unless aTargetMax is very high and then we scale with it; this help in quicker restart
return float(max(max_accel, a_target / A_CRUISE_MAX_VALS[0])) * min(speedLimiter, accelLimiter)
return float(max(max_accel, a_target / CarControllerParams.ACCEL_MAX)) * min(speedLimiter, accelLimiter)
@staticmethod
def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # pylint: disable=dangerous-default-value

View File

@ -7,6 +7,8 @@ Ecu = car.CarParams.Ecu
VisualAlert = car.CarControl.HUDControl.VisualAlert
class CarControllerParams():
ACCEL_MAX = 1.6
def __init__(self, CP):
self.BRAKE_MAX = 1024//4
self.STEER_MAX = CP.lateralParams.torqueBP[-1]