def param_load(self): self.command_cnt += 1 if self.command_cnt > 100: self.command_cnt = 0 if self.command_cnt % 10: return self.command_load += 1 if self.command_load == 1: self.param_OpkrAccelProfile = int( self.params.get('OpkrAccelProfile')) elif self.command_load == 2: self.param_OpkrAutoResume = int(self.params.get('OpkrAutoResume')) elif self.command_load == 3: self.param_OpkrWhoisDriver = int( self.params.get('OpkrWhoisDriver')) else: self.command_load = 0 # speed controller if self.param_preOpkrAccelProfile != self.param_OpkrAccelProfile: self.param_preOpkrAccelProfile = self.param_OpkrAccelProfile if self.param_OpkrAccelProfile == 1: self.SC = SpdctrlSlow() elif self.param_OpkrAccelProfile == 2: self.SC = SpdctrlNormal() else: self.SC = SpdctrlNormal()
def __init__(self, dbc_name, CP, VM): self.CP = CP self.apply_steer_last = 0 self.car_fingerprint = CP.carFingerprint self.packer = CANPacker(dbc_name) self.steer_rate_limited = False # resume self.resume_cnt = 0 self.last_resume_frame = 0 self.last_lead_distance = 0 self.lkas11_cnt = 0 # hud self.hud_timer_left = 0 self.hud_timer_right = 0 self.enable_time = 0 self.steer_torque_over_timer = 0 self.steer_torque_ratio = 1 self.timer1 = tm.CTime1000("time") self.SC = SpdctrlSlow() self.model_speed = 0 self.model_sum = 0
def __init__(self, dbc_name, CP, VM): self.CP = CP self.apply_steer_last = 0 self.car_fingerprint = CP.carFingerprint self.packer = CANPacker(dbc_name) self.steer_rate_limited = False self.resume_cnt = 0 self.last_resume_frame = 0 self.last_lead_distance = 0 self.lanechange_manual_timer = 0 self.emergency_manual_timer = 0 self.driver_steering_torque_above_timer = 0 self.mode_change_timer = 0 self.steer_mode = "" self.mdps_status = "" self.lkas_switch = "" self.lkas11_cnt = 0 self.nBlinker = 0 self.dRel = 0 self.yRel = 0 self.vRel = 0 self.timer1 = tm.CTime1000("time") self.model_speed = 0 self.model_sum = 0 # hud self.hud_timer_left = 0 self.hud_timer_right = 0 self.traceCC = trace1.Loger("CarController") self.cruise_gap = 0 self.cruise_gap_prev = 0 self.cruise_gap_set_init = 0 self.cruise_gap_switch_timer = 0 self.params = Params() self.mode_change_switch = int( self.params.get('CruiseStatemodeSelInit')) self.param_OpkrAccelProfile = int(self.params.get('OpkrAccelProfile')) self.param_OpkrAutoResume = int(self.params.get('OpkrAutoResume')) if self.param_OpkrAccelProfile == 1: self.SC = SpdctrlSlow() elif self.param_OpkrAccelProfile == 2: self.SC = SpdctrlNormal() else: self.SC = SpdctrlFast()
def __init__(self, dbc_name, CP, VM): self.CP = CP self.p = SteerLimitParams(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 self.last_lead_distance = 0 self.resume_cnt = 0 self.lkas11_cnt = 0 self.nBlinker = 0 self.lane_change_torque_lower = 0 self.steer_torque_over_timer = 0 self.steer_torque_ratio = 1 self.steer_torque_ratio_dir = 1 self.dRel = 0 self.yRel = 0 self.vRel = 0 self.timer1 = tm.CTime1000("time") self.model_speed = 0 self.model_sum = 0 # hud self.hud_timer_left = 0 self.hud_timer_right = 0 self.hud_sys_state = 0 self.command_cnt = 0 self.command_load = 0 self.params = Params() self.SC = SpdctrlSlow() self.traceCC = trace1.Loger("CarController")