コード例 #1
0
    def __init__(self, CP, CarController):
        self.CP = CP

        self.frame = 0
        self.gas_pressed_prev = False
        self.brake_pressed_prev = False
        self.acc_active_prev = 0

        # *** init the major players ***
        canbus = CanBus()
        self.CS = CarState(CP, canbus)
        self.VM = VehicleModel(CP)
        self.pt_cp = get_powertrain_can_parser(CP, canbus)
        self.ch_cp_dbc_name = DBC[CP.carFingerprint]['chassis']

        self.CC = None
        if CarController is not None:
            self.CC = CarController(canbus, CP.carFingerprint)
コード例 #2
0
ファイル: interface.py プロジェクト: Reyuuk/openpilot
  def __init__(self, CP, sendcan=None):
    self.CP = CP

    self.frame = 0
    self.gas_pressed_prev = False
    self.brake_pressed_prev = False
    self.can_invalid_count = 0
    self.acc_active_prev = 0

    # *** init the major players ***
    canbus = CanBus()
    self.CS = CarState(CP, canbus)
    self.VM = VehicleModel(CP)
    self.pt_cp = get_powertrain_can_parser(CP, canbus)
    self.ch_cp_dbc_name = DBC[CP.carFingerprint]['chassis']

    # sending if read only is False
    if sendcan is not None:
      self.sendcan = sendcan
      self.CC = CarController(canbus, CP.carFingerprint, CP.enableCamera)