Ejemplo n.º 1
0
    def __init__(self, CP, sendcan=None):
        self.CP = CP
        self.VM = VehicleModel(CP)

        self.frame = 0
        self.gas_pressed_prev = False
        self.brake_pressed_prev = False
        self.can_invalid_count = 0
        self.cam_can_valid_count = 0
        self.cruise_enabled_prev = False

        # *** init the major players ***
        self.CS = CarState(CP)

        self.cp = get_can_parser(CP)
        self.cp_cam = get_cam_can_parser(CP)

        self.forwarding_camera = False

        # sending if read only is False
        if sendcan is not None:
            self.sendcan = sendcan
            self.CC = CarController(self.cp.dbc_name, CP.carFingerprint,
                                    CP.enableCamera, CP.enableDsu,
                                    CP.enableApgs)
Ejemplo n.º 2
0
  def __init__(self, CP, CarController):
    self.CP = CP
    self.VM = VehicleModel(CP)

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

    # *** init the major players ***
    self.CS = CarState(CP)

    self.cp = get_can_parser(CP)
    self.cp_cam = get_cam_can_parser(CP)

    self.CC = None
    if CarController is not None:
      self.CC = CarController(self.cp.dbc_name, CP.carFingerprint, CP.enableCamera, CP.enableDsu, CP.enableApgs)