Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Aug 23, 2022
1 parent 40c4de4 commit 62a811a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions selfdrive/car/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,20 @@ def setUpClass(cls):
car_fw = []
can_msgs = []
fingerprint = defaultdict(dict)
CP = None
for msg in lr:
if msg.which() == "can":
for m in msg.can:
if m.src < 64:
fingerprint[m.src][m.address] = len(m.dat)
can_msgs.append(msg)
elif msg.which() == "carParams":
car_fw = msg.carParams.carFw
if msg.carParams.openpilotLongitudinalControl:
CP = msg.carParams
car_fw = CP.carFw
if CP.openpilotLongitudinalControl:
disable_radar = True
if cls.car_model is None and not cls.ci:
cls.car_model = msg.carParams.carFingerprint
cls.car_model = CP.carFingerprint

if len(can_msgs) > int(50 / DT_CTRL):
break
Expand All @@ -104,6 +106,11 @@ def setUpClass(cls):

cls.can_msgs = sorted(can_msgs, key=lambda msg: msg.logMonoTime)

# Sets enableDsu for cars with missing carFw
# TODO: get new route for TOYOTA.LEXUS_CTH
if len(car_fw) == 0 and CP is not None and CP.enableDsu:
car_fw = [car.CarParams.CarFw(ecu=car.CarParams.Ecu.unknown)]

cls.CarInterface, cls.CarController, cls.CarState = interfaces[cls.car_model]
cls.CP = cls.CarInterface.get_params(cls.car_model, fingerprint, car_fw, disable_radar)
assert cls.CP
Expand Down

0 comments on commit 62a811a

Please sign in to comment.