From b8a4adfb2f68e93c63f95935bd2fff2a3a40c20f Mon Sep 17 00:00:00 2001 From: HaraldSchafer Date: Wed, 14 Jul 2021 11:06:29 -0700 Subject: [PATCH] hard honda max accel in car interface (#21585) * hard set in car interface, not related to planning * move to values --- selfdrive/car/honda/interface.py | 5 ++--- selfdrive/car/honda/values.py | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index b4eef75cbc..15446623c9 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -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 diff --git a/selfdrive/car/honda/values.py b/selfdrive/car/honda/values.py index 245213e2b1..289fab9f88 100644 --- a/selfdrive/car/honda/values.py +++ b/selfdrive/car/honda/values.py @@ -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]