Esempio n. 1
0
 def __init__(self, dbc_name, CP, VM):
     self.apply_steer_last = 0
     self.car_fingerprint = CP.carFingerprint
     self.cp_oplongcontrol = CP.openpilotLongitudinalControl
     self.packer = CANPacker(dbc_name)
     self.accel_steady = 0
     self.accel_lim_prev = 0.
     self.accel_lim = 0.
     self.steer_rate_limited = False
     self.p = CarControllerParams(CP)
     self.usestockscc = True
     self.lead_visible = False
     self.lead_debounce = 0
     self.gapsettingdance = 2
     self.gapcount = 0
     self.current_veh_speed = 0
     self.lfainFingerprint = CP.lfaAvailable
     self.vdiff = 0
     self.resumebuttoncnt = 0
     self.fca11supcnt = self.fca11inc = self.fca11alivecnt = self.fca11cnt13 = self.scc11cnt = self.scc12cnt = 0
     self.lastresumeframe = 0
     self.counter_init = False
     self.fca11maxcnt = 0xD
     self.radarDisableActivated = False
     self.radarDisableResetTimer = 0
     self.radarDisableOverlapTimer = 0
     self.sendaccmode = not CP.radarDisablePossible
     self.enabled = False
     self.sm = messaging.SubMaster(['controlsState'])
     self.steer_wind_down = False
Esempio n. 2
0
    def __init__(self, dbc_name, CP, VM):
        self.p = CarControllerParams(CP)
        self.packer = CANPacker(dbc_name)

        self.apply_steer_last = 0
        self.car_fingerprint = CP.carFingerprint
        self.steer_rate_limited = False
        self.last_resume_frame = 0
Esempio n. 3
0
    def __init__(self, dbc_name, CP, VM):
        self.CP = CP
        self.params = CarControllerParams(CP)
        self.packer = CANPacker(dbc_name)
        self.frame = 0

        self.apply_steer_last = 0
        self.car_fingerprint = CP.carFingerprint
        self.last_button_frame = 0
        self.accel = 0
Esempio n. 4
0
    def __init__(self, dbc_name, CP, VM):
        # dp
        self.last_blinker_on = False
        self.blinker_end_frame = 0.
        self.dp_hkg_smart_mdps = Params().get('dp_hkg_smart_mdps') == b'1'

        self.p = CarControllerParams(CP)
        self.packer = CANPacker(dbc_name)

        self.apply_steer_last = 0
        self.car_fingerprint = CP.carFingerprint
        self.steer_rate_limited = False
        self.last_resume_frame = 0
Esempio n. 5
0
    def __init__(self, dbc_name, CP, VM):
        self.CP = CP
        self.params = CarControllerParams(CP)
        self.packer = CANPacker(dbc_name)
        self.frame = 0

        self.apply_steer_last = 0
        self.last_button_frame = 0
        self.accel = 0
        self.lkas11_cnt = 0
        self.scc12_cnt = -1

        self.resume_cnt = 0
        self.last_lead_distance = 0
        self.resume_wait_timer = 0

        self.turning_signal_timer = 0
        self.longcontrol = CP.openpilotLongitudinalControl
        self.scc_live = not CP.radarOffCan

        self.turning_indicator_alert = False

        param = Params()

        self.mad_mode_enabled = param.get_bool('MadModeEnabled')
        self.ldws_opt = param.get_bool('IsLdwsCar')
        self.stock_navi_decel_enabled = param.get_bool('StockNaviDecelEnabled')
        self.keep_steering_turn_signals = param.get_bool(
            'KeepSteeringTurnSignals')
        self.haptic_feedback_speed_camera = param.get_bool(
            'HapticFeedbackWhenSpeedCamera')

        self.scc_smoother = SccSmoother()
        self.last_blinker_frame = 0
        self.prev_active_cam = False
        self.active_cam_timer = 0
        self.last_active_cam_frame = 0

        self.angle_limit_counter = 0
        self.cut_steer_frames = 0
        self.cut_steer = False

        self.steer_fault_max_angle = CP.steerFaultMaxAngle
        self.steer_fault_max_frames = CP.steerFaultMaxFrames
Esempio n. 6
0
    def __init__(self, dbc_name, CP, VM):
        self.p = CarControllerParams(CP)
        self.packer = CANPacker(dbc_name)

        self.apply_steer_last = 0
        self.car_fingerprint = CP.carFingerprint
        self.steer_rate_limited = False
        self.lkas11_cnt = 0
        self.scc12_cnt = 0
        self.last_resume_frame = 0
        self.last_lead_distance = 0
        self.turning_signal_timer = 0
        self.longcontrol = CP.openpilotLongitudinalControl
        self.scc_live = not CP.radarOffCan
        self.accel_steady = 0
        if CP.spasEnabled:
            self.en_cnt = 0
            self.apply_steer_ang = 0.0
            self.en_spas = 3
            self.mdps11_stat_last = 0
            self.spas_always = False
Esempio n. 7
0
    def __init__(self, CP):
        super().__init__(CP)
        can_define = CANDefine(DBC[CP.carFingerprint]["pt"])

        self.cruise_buttons = deque([Buttons.NONE] * PREV_BUTTON_SAMPLES,
                                    maxlen=PREV_BUTTON_SAMPLES)
        self.main_buttons = deque([Buttons.NONE] * PREV_BUTTON_SAMPLES,
                                  maxlen=PREV_BUTTON_SAMPLES)

        if CP.carFingerprint in CANFD_CAR:
            self.shifter_values = can_define.dv["GEAR_SHIFTER"]["GEAR"]
        elif self.CP.carFingerprint in FEATURES["use_cluster_gears"]:
            self.shifter_values = can_define.dv["CLU15"]["CF_Clu_Gear"]
        elif self.CP.carFingerprint in FEATURES["use_tcu_gears"]:
            self.shifter_values = can_define.dv["TCU12"]["CUR_GR"]
        else:  # preferred and elect gear methods use same definition
            self.shifter_values = can_define.dv["LVR12"]["CF_Lvr_Gear"]

        self.brake_error = False
        self.park_brake = False
        self.buttons_counter = 0

        self.params = CarControllerParams(CP)