Files
StarPilot/selfdrive/car/__init__.py
T
Vehicle Researcher 46e0ee7750 openpilot v0.3.4 release
old-commit-hash: 6f46f988d9
2017-07-28 03:23:57 -07:00

31 lines
842 B
Python

from common.fingerprints import fingerprint
from .honda.interface import CarInterface as HondaInterface
try:
from .simulator.interface import CarInterface as SimInterface
except ImportError:
SimInterface = None
try:
from .simulator2.interface import CarInterface as Sim2Interface
except ImportError:
Sim2Interface = None
interfaces = {
"HONDA CIVIC 2016 TOURING": HondaInterface,
"ACURA ILX 2016 ACURAWATCH PLUS": HondaInterface,
"HONDA ACCORD 2016 TOURING": HondaInterface,
"HONDA CR-V 2016 TOURING": HondaInterface,
"simulator": SimInterface,
"simulator2": Sim2Interface
}
def get_car(logcan, sendcan=None):
candidate, fingerprints = fingerprint(logcan)
interface_cls = interfaces[candidate]
params = interface_cls.get_params(candidate, fingerprints)
return interface_cls(params, logcan, sendcan), params