|
|
|
@ -15,7 +15,7 @@ from openpilot.common.swaglog import cloudlog, ForwardingHandler |
|
|
|
|
from openpilot.selfdrive.pandad import can_capnp_to_list, can_list_to_can_capnp |
|
|
|
|
from openpilot.selfdrive.car import DT_CTRL, carlog |
|
|
|
|
from openpilot.selfdrive.car.can_definitions import CanData, CanRecvCallable, CanSendCallable |
|
|
|
|
from openpilot.selfdrive.car.car_specific import CarSpecificEvents |
|
|
|
|
from openpilot.selfdrive.car.car_specific import CarSpecificEvents, MockCarState |
|
|
|
|
from openpilot.selfdrive.car.fw_versions import ObdCallback |
|
|
|
|
from openpilot.selfdrive.car.car_helpers import get_car |
|
|
|
|
from openpilot.selfdrive.car.interfaces import CarInterfaceBase |
|
|
|
@ -133,6 +133,7 @@ class Car: |
|
|
|
|
self.events = Events() |
|
|
|
|
|
|
|
|
|
self.car_events = CarSpecificEvents(self.CP) |
|
|
|
|
self.mock_carstate = MockCarState() |
|
|
|
|
|
|
|
|
|
# card is driven by can recv, expected at 100Hz |
|
|
|
|
self.rk = Ratekeeper(100, print_delay_threshold=None) |
|
|
|
@ -144,6 +145,9 @@ class Car: |
|
|
|
|
can_strs = messaging.drain_sock_raw(self.can_sock, wait_for_one=True) |
|
|
|
|
CS = self.CI.update(can_capnp_to_list(can_strs)) |
|
|
|
|
|
|
|
|
|
if self.CP.carName == 'mock': |
|
|
|
|
CS = self.mock_carstate.update(CS) |
|
|
|
|
|
|
|
|
|
self.sm.update(0) |
|
|
|
|
|
|
|
|
|
can_rcv_valid = len(can_strs) > 0 |
|
|
|
|