|
|
|
@ -2,6 +2,7 @@ import cereal.messaging as messaging |
|
|
|
|
|
|
|
|
|
from opendbc.can.packer import CANPacker |
|
|
|
|
from opendbc.can.parser import CANParser |
|
|
|
|
from openpilot.common.params import Params |
|
|
|
|
from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp |
|
|
|
|
from openpilot.selfdrive.car import crc8_pedal |
|
|
|
|
from openpilot.tools.sim.lib.common import SimulatorState |
|
|
|
@ -18,6 +19,8 @@ class SimulatedCar: |
|
|
|
|
self.sm = messaging.SubMaster(['carControl', 'controlsState', 'carParams']) |
|
|
|
|
self.cp = self.get_car_can_parser() |
|
|
|
|
self.idx = 0 |
|
|
|
|
self.params = Params() |
|
|
|
|
self.obd_multiplexing = False |
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
|
def get_car_can_parser(): |
|
|
|
@ -100,6 +103,11 @@ class SimulatedCar: |
|
|
|
|
|
|
|
|
|
def send_panda_state(self, simulator_state): |
|
|
|
|
self.sm.update(0) |
|
|
|
|
|
|
|
|
|
if self.params.get_bool("ObdMultiplexingEnabled") != self.obd_multiplexing: |
|
|
|
|
self.obd_multiplexing = not self.obd_multiplexing |
|
|
|
|
self.params.put_bool("ObdMultiplexingChanged", True) |
|
|
|
|
|
|
|
|
|
dat = messaging.new_message('pandaStates', 1) |
|
|
|
|
dat.valid = True |
|
|
|
|
dat.pandaStates[0] = { |
|
|
|
|