mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 19:12:07 +08:00
no more old nidec (#22104)
old-commit-hash: c93f3b10f725ee581884faa764407866fb69733c
This commit is contained in:
@@ -5,7 +5,7 @@ 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.honda import hondacan
|
||||
from selfdrive.car.honda.values import OLD_NIDEC_LONG_CONTROL, CruiseButtons, VISUAL_HUD, HONDA_BOSCH, CarControllerParams
|
||||
from selfdrive.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, CarControllerParams
|
||||
from opendbc.can.packer import CANPacker
|
||||
|
||||
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
||||
@@ -183,20 +183,18 @@ class CarController():
|
||||
|
||||
# wind brake from air resistance decel at high speed
|
||||
wind_brake = interp(CS.out.vEgo, [0.0, 2.3, 35.0], [0.001, 0.002, 0.15])
|
||||
if CS.CP.carFingerprint in OLD_NIDEC_LONG_CONTROL:
|
||||
#pcm_speed = pcm_speed
|
||||
pcm_accel = int(clip(pcm_accel, 0, 1) * 0xc6)
|
||||
else:
|
||||
max_accel = interp(CS.out.vEgo, P.NIDEC_MAX_ACCEL_BP, P.NIDEC_MAX_ACCEL_V)
|
||||
# TODO this 1.44 is just to maintain previous behavior
|
||||
pcm_accel = int(clip((accel/1.44)/max_accel, 0.0, 1.0) * 0xc6)
|
||||
pcm_speed_BP = [-wind_brake,
|
||||
-wind_brake*(3/4),
|
||||
|
||||
# All of this is only relevant for HONDA NIDEC
|
||||
max_accel = interp(CS.out.vEgo, P.NIDEC_MAX_ACCEL_BP, P.NIDEC_MAX_ACCEL_V)
|
||||
# TODO this 1.44 is just to maintain previous behavior
|
||||
pcm_accel = int(clip((accel/1.44)/max_accel, 0.0, 1.0) * 0xc6)
|
||||
pcm_speed_BP = [-wind_brake,
|
||||
-wind_brake*(3/4),
|
||||
0.0]
|
||||
pcm_speed_V = [0.0,
|
||||
clip(CS.out.vEgo + accel/2.0 - 2.0, 0.0, 100.0),
|
||||
clip(CS.out.vEgo + accel/2.0 + 2.0, 0.0, 100.0)]
|
||||
pcm_speed = interp(-brake, pcm_speed_BP, pcm_speed_V)
|
||||
pcm_speed_V = [0.0,
|
||||
clip(CS.out.vEgo + accel/2.0 - 2.0, 0.0, 100.0),
|
||||
clip(CS.out.vEgo + accel/2.0 + 2.0, 0.0, 100.0)]
|
||||
pcm_speed = interp(-brake, pcm_speed_BP, pcm_speed_V)
|
||||
|
||||
if not CS.CP.openpilotLongitudinalControl:
|
||||
if (frame % 2) == 0:
|
||||
|
||||
@@ -1263,6 +1263,5 @@ SPEED_FACTOR = {
|
||||
CAR.HRV: 1.025,
|
||||
}
|
||||
|
||||
OLD_NIDEC_LONG_CONTROL = set([CAR.ODYSSEY, CAR.ACURA_RDX, CAR.CRV, CAR.HRV])
|
||||
HONDA_BOSCH = set([CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_5G, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G])
|
||||
HONDA_BOSCH_ALT_BRAKE_SIGNAL = set([CAR.ACCORD, CAR.CRV_5G, CAR.ACURA_RDX_3G])
|
||||
|
||||
Reference in New Issue
Block a user