mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-20 08:42:11 +08:00
Don't Brake Check
This commit is contained in:
@@ -472,7 +472,8 @@ def should_publish_planner_fcw(crash_cnt: int, car_state, radar_state) -> bool:
|
||||
|
||||
def get_vehicle_min_accel(CP, v_ego):
|
||||
# Planner-side physical decel capability estimate for GM pedal-long paths.
|
||||
if getattr(CP, "carName", "") == "gm" and getattr(CP, "enableGasInterceptorDEPRECATED", False):
|
||||
is_gm = getattr(CP, "carName", "") == "gm" or getattr(CP, "brand", "") == "gm"
|
||||
if is_gm and getattr(CP, "enableGasInterceptorDEPRECATED", False):
|
||||
try:
|
||||
from opendbc.car.gm.values import GMFlags, CAR
|
||||
if bool(CP.flags & GMFlags.PEDAL_LONG.value):
|
||||
|
||||
@@ -9,6 +9,7 @@ import pytest
|
||||
from cereal import log
|
||||
from opendbc.car.honda.interface import CarInterface
|
||||
from opendbc.car.honda.values import CAR
|
||||
from opendbc.car.gm.values import CAR as GM_CAR, GMFlags
|
||||
import openpilot.selfdrive.controls.lib.longitudinal_planner as longitudinal_planner_module
|
||||
from openpilot.selfdrive.controls.lib.longcontrol import LongCtrlState
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import CONTROL_N
|
||||
@@ -146,6 +147,18 @@ def test_experimental_mlsim_uses_vehicle_min_accel_floor(model_version):
|
||||
assert planner.output_a_target < comfort_min_accel
|
||||
|
||||
|
||||
def test_gm_pedal_vehicle_min_accel_uses_brand_when_car_name_is_missing():
|
||||
CP = SimpleNamespace(
|
||||
carName=None,
|
||||
brand="gm",
|
||||
enableGasInterceptorDEPRECATED=True,
|
||||
flags=GMFlags.PEDAL_LONG.value,
|
||||
carFingerprint=GM_CAR.CHEVROLET_BOLT_ACC_2022_2023_PEDAL,
|
||||
)
|
||||
|
||||
assert get_vehicle_min_accel(CP, 32.4) == pytest.approx(-2.95)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model_version", ["v11", "v12", "v13", "v14", "v15"])
|
||||
def test_acc_mode_uses_close_raw_lead_when_tracking_lead_is_debounced(model_version):
|
||||
v_ego = 5.0
|
||||
|
||||
Reference in New Issue
Block a user