mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
eefc084302
version: sunnypilot v2025.003.000 (dev) date: 2025-12-18T05:48:43 master commit: 16c052af0835f049a67b80251d8cc1114fc08bb4
33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
from parameterized import parameterized
|
|
|
|
from opendbc.car.car_helpers import interfaces
|
|
from opendbc.car.honda.values import CAR as HONDA
|
|
from opendbc.car.hyundai.values import CAR as HYUNDAI
|
|
from opendbc.car.toyota.values import CAR as TOYOTA
|
|
from openpilot.common.params import Params
|
|
from openpilot.common.realtime import DT_CTRL
|
|
from openpilot.selfdrive.car.helpers import convert_to_capnp
|
|
from openpilot.selfdrive.controls.lib.latcontrol_torque import LatControlTorque
|
|
from openpilot.sunnypilot.selfdrive.car import interfaces as sunnypilot_interfaces
|
|
|
|
|
|
class TestNNTorqueModel:
|
|
|
|
@parameterized.expand([HONDA.HONDA_CIVIC, TOYOTA.TOYOTA_RAV4, HYUNDAI.HYUNDAI_SANTA_CRUZ_1ST_GEN])
|
|
def test_load_model(self, car_name):
|
|
params = Params()
|
|
params.put_bool("NeuralNetworkLateralControl", True)
|
|
|
|
CarInterface = interfaces[car_name]
|
|
CP = CarInterface.get_non_essential_params(car_name)
|
|
CP_SP = CarInterface.get_non_essential_params_sp(CP, car_name)
|
|
CI = CarInterface(CP, CP_SP)
|
|
|
|
sunnypilot_interfaces.setup_interfaces(CI, params)
|
|
|
|
CP_SP = convert_to_capnp(CP_SP)
|
|
|
|
controller = LatControlTorque(CP.as_reader(), CP_SP.as_reader(), CI, DT_CTRL)
|
|
|
|
assert controller.extension.has_nn_model
|