Example #1
0
  def __init__(self, CP, sendcan=None):
    self.CP = CP

    self.frame = 0
    self.last_enable_pressed = 0
    self.last_enable_sent = 0
    self.gas_pressed_prev = False
    self.brake_pressed_prev = False
    self.can_invalid_count = 0

    self.cp = get_can_parser(CP)

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

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

    if self.CS.CP.carFingerprint == CAR.ACURA_ILX:
      self.compute_gb = get_compute_gb_acura()
    else:
      self.compute_gb = compute_gb_honda
Example #2
0
    def __init__(self, CP, CarController):
        self.CP = CP

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

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

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

        self.CC = None
        if CarController is not None:
            self.CC = CarController(self.cp.dbc_name)

        if self.CS.CP.carFingerprint == CAR.ACURA_ILX:
            self.compute_gb = get_compute_gb_acura()
        else:
            self.compute_gb = compute_gb_honda
Example #3
0
    def __init__(self, CP, sendcan=None):
        self.CP = CP

        self.frame = 0
        self.last_enable_pressed = 0
        self.last_enable_sent = 0
        self.gas_pressed_prev = False
        self.brake_pressed_prev = False
        self.can_invalid_count = 0

        self.cp = get_can_parser(CP)

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

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

        if self.CS.accord:
            # self.accord_msg = []
            raise NotImplementedError

        if not self.CS.civic:
            self.compute_gb = get_compute_gb_acura()
        else:
            self.compute_gb = compute_gb_honda
Example #4
0
    def __init__(self, CP, CarController):
        self.CP = CP

        self.frame = 0
        self.last_enable_pressed = 0
        self.last_enable_sent = 0
        self.gas_pressed_prev = False
        self.brake_pressed_prev = False
        self.stock_cam_frame_prev = 0

        self.cp = get_can_parser(CP)
        self.cp_cam = get_cam_can_parser(CP.isPandaBlack)
        self.CP.canIds = [[int(x) for x in self.cp.addr],
                          [int(x) for x in self.cp_cam.addr]]

        # *** init the major players ***
        self.CS = CarState(CP)
        #self.VM = VehicleModel(CP)
        self.canTime = 0
        self.CC = None
        if CarController is not None:
            self.CC = CarController(self.cp.dbc_name)
        if self.CS.CP.carFingerprint == CAR.ACURA_ILX:
            self.compute_gb = get_compute_gb_acura()
        else:
            self.compute_gb = compute_gb_honda

        if self.CS.CP.carFingerprint in HONDA_BOSCH and self.CS.CP.carFingerprint not in (
                CAR.CRV_HYBRID, CAR.CRV, CAR.CRV_5G):
            self.bosch_honda = True
        else:
            self.bosch_honda = False
Example #5
0
    def __init__(self, read_only=False):
        context = zmq.Context()
        self.logcan = messaging.sub_sock(context, service_list['can'].port)

        self.frame = 0

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

        # sending if read only is False
        if not read_only:
            self.sendcan = messaging.pub_sock(context,
                                              service_list['sendcan'].port)
            self.CC = CarController()
Example #6
0
    def __init__(self, read_only=False):
        context = zmq.Context()
        # self.logcan = messaging.sub_sock(context, service_list['can'].port)

        self.frame = 0
        self.can_invalid_count = 0

        # *** init the major players ***
        self.CS = CarState(None)
        self.CS.angle_steers = 0.0

        # sending if read only is False
        if not read_only:
            # self.sendcan = messaging.pub_sock(context, service_list['sendcan'].port)
            self.CC = CarController()
Example #7
0
    def __init__(self, CP, logcan, sendcan=None):
        self.logcan = logcan
        self.CP = CP

        self.frame = 0
        self.can_invalid_count = 0

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

        # sending if read only is False
        if sendcan is not None:
            self.sendcan = sendcan
            self.CC = CarController()

        if self.CS.accord:
            self.accord_msg = []
Example #8
0
    def __init__(self, CP, logcan, sendcan=None):
        self.logcan = logcan
        self.CP = CP

        self.frame = 0
        self.last_enable_pressed = 0
        self.last_enable_sent = 0
        self.gas_pressed_prev = False
        self.brake_pressed_prev = False
        self.can_invalid_count = 0

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

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

        if self.CS.accord:
            # self.accord_msg = []
            raise NotImplementedError