Honda Nidec: put max PCM gas into CarControllerParams (#26645)

* limit gas

* bump panda

* not sure why it was represented like this
old-commit-hash: 997b2e11ae
taco
Shane Smiskol 2 years ago committed by GitHub
parent 5f8b46eabe
commit 8da61ba4cc
  1. 6
      selfdrive/car/honda/carcontroller.py
  2. 1
      selfdrive/car/honda/values.py

@ -189,14 +189,14 @@ class CarController:
clip(CS.out.vEgo + 0.0, 0.0, 100.0),
clip(CS.out.vEgo + 5.0, 0.0, 100.0)]
pcm_speed = interp(gas - brake, pcm_speed_BP, pcm_speed_V)
pcm_accel = int(1.0 * 0xc6)
pcm_accel = int(1.0 * self.params.NIDEC_GAS_MAX)
else:
pcm_speed_V = [0.0,
clip(CS.out.vEgo - 2.0, 0.0, 100.0),
clip(CS.out.vEgo + 2.0, 0.0, 100.0),
clip(CS.out.vEgo + 5.0, 0.0, 100.0)]
pcm_speed = interp(gas - brake, pcm_speed_BP, pcm_speed_V)
pcm_accel = int(clip((accel / 1.44) / max_accel, 0.0, 1.0) * 0xc6)
pcm_accel = int(clip((accel / 1.44) / max_accel, 0.0, 1.0) * self.params.NIDEC_GAS_MAX)
if not self.CP.openpilotLongitudinalControl:
if self.frame % 2 == 0 and self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS: # radarless cars don't have supplemental message
@ -254,7 +254,7 @@ class CarController:
self.speed = pcm_speed
if not self.CP.enableGasInterceptor:
self.gas = pcm_accel / 0xc6
self.gas = pcm_accel / self.params.NIDEC_GAS_MAX
new_actuators = actuators.copy()
new_actuators.speed = self.speed

@ -27,6 +27,7 @@ class CarControllerParams:
NIDEC_MAX_ACCEL_V = [0.5, 2.4, 1.4, 0.6]
NIDEC_MAX_ACCEL_BP = [0.0, 4.0, 10., 20.]
NIDEC_GAS_MAX = 198 # 0xc6
NIDEC_BRAKE_MAX = 1024 // 4
BOSCH_ACCEL_MIN = -3.5 # m/s^2

Loading…
Cancel
Save