예제 #1
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.CC = None
        if CarController is not None:
            self.CC = CarController(self.cp.dbc_name, CP.enableCamera, self.VM)
예제 #2
0
    def __init__(self, CP, sendcan=None):
        self.CP = CP
        self.VM = VehicleModel(CP)

        self.frame = 0
        self.can_invalid_count = 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)

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