pull/33208/head
Shane Smiskol 1 year ago
parent e97d4fa107
commit 26c02c7f5e
  1. 17
      selfdrive/car/tests/test_car_interfaces.py

@ -7,7 +7,7 @@ from parameterized import parameterized
from cereal import car, messaging from cereal import car, messaging
from openpilot.selfdrive.car import DT_CTRL, gen_empty_fingerprint from openpilot.selfdrive.car import DT_CTRL, gen_empty_fingerprint
from openpilot.selfdrive.car.card import convert_carControl from openpilot.selfdrive.car.card import convert_carControl, convert_to_capnp
from openpilot.selfdrive.car.car_helpers import interfaces from openpilot.selfdrive.car.car_helpers import interfaces
from openpilot.selfdrive.car.structs import CarParams from openpilot.selfdrive.car.structs import CarParams
from openpilot.selfdrive.car.fingerprints import all_known_cars from openpilot.selfdrive.car.fingerprints import all_known_cars
@ -114,13 +114,14 @@ class TestCarInterfaces:
# Test controller initialization # Test controller initialization
# TODO: wait until card refactor is merged to run controller a few times, # TODO: wait until card refactor is merged to run controller a few times,
# hypothesis also slows down significantly with just one more message draw # hypothesis also slows down significantly with just one more message draw
LongControl(car_params) car_params_capnp = convert_to_capnp(car_params).as_reader()
if car_params.steerControlType == CarParams.SteerControlType.angle: LongControl(car_params_capnp)
LatControlAngle(car_params, car_interface) if car_params_capnp.steerControlType == CarParams.SteerControlType.angle:
elif car_params.lateralTuning.which() == 'pid': LatControlAngle(car_params_capnp, car_interface)
LatControlPID(car_params, car_interface) elif car_params_capnp.lateralTuning.which() == 'pid':
elif car_params.lateralTuning.which() == 'torque': LatControlPID(car_params_capnp, car_interface)
LatControlTorque(car_params, car_interface) elif car_params_capnp.lateralTuning.which() == 'torque':
LatControlTorque(car_params_capnp, car_interface)
# Test radar interface # Test radar interface
RadarInterface = importlib.import_module(f'selfdrive.car.{car_params.carName}.radar_interface').RadarInterface RadarInterface = importlib.import_module(f'selfdrive.car.{car_params.carName}.radar_interface').RadarInterface

Loading…
Cancel
Save