def __init__(self, mpc_id): self.mpc_id = mpc_id self.op_params = opParams() self.df_profiles = dfProfiles() self.df_manager = dfManager(self.op_params) if not travis and mpc_id == 1: self.pm = messaging.PubMaster(['dynamicFollowData']) else: self.pm = None # Model variables mpc_rate = 1 / 20. self.model_scales = { 'v_ego': [-0.06112159043550491, 37.96522521972656], 'a_lead': [-3.109330892562866, 3.3612186908721924], 'v_lead': [0.0, 35.27671432495117], 'x_lead': [2.4600000381469727, 141.44000244140625] } self.predict_rate = 1 / 4. self.skip_every = round(0.25 / mpc_rate) self.model_input_len = round(45 / mpc_rate) # Dynamic follow variables self.default_TR = 1.8 self.TR = 1.8 self.v_ego_retention = 2.5 self.v_rel_retention = 1.75 self.sng_TR = 1.8 # reacceleration stop and go TR self.sng_speed = 18.0 * CV.MPH_TO_MS self._setup_collector() self._setup_changing_variables()
def __init__(self): self.op_params = opParams() self.df_profiles = dfProfiles() self.sm = messaging.SubMaster( ['dynamicFollowButton', 'dynamicFollowData']) self.button_updated = False self.cur_user_profile = self.op_params.get( 'dynamic_follow').strip().lower() if not isinstance( self.cur_user_profile, str) or self.cur_user_profile not in self.df_profiles.to_idx: self.cur_user_profile = self.df_profiles.default # relaxed self.op_params.put( 'dynamic_follow', self.df_profiles.to_profile[self.cur_user_profile]) else: self.cur_user_profile = self.df_profiles.to_idx[ self.cur_user_profile] self.last_user_profile = self.cur_user_profile self.cur_model_profile = 0 self.alert_duration = 2.0 self.profile_pred = None self.change_time = sec_since_boot() self.first_run = True self.last_is_auto = False
def __init__(self, mpc_id): self.mpc_id = mpc_id self.df_profiles = dfProfiles() # Model variables mpc_rate = 1 / 20. self.model_scales = { 'v_ego': [-0.06112159043550491, 37.96522521972656], 'a_lead': [-3.109330892562866, 3.3612186908721924], 'v_lead': [0.0, 35.27671432495117], 'x_lead': [2.4600000381469727, 141.44000244140625] } self.predict_rate = 1 / 4. self.skip_every = round(0.25 / mpc_rate) self.model_input_len = round(45 / mpc_rate) # Dynamic follow variables self.default_TR = 1.8 self.TR = 1.8 # self.v_lead_retention = 2.0 # keep only last x seconds self.v_ego_retention = 2.5 self.v_rel_retention = 1.5 self.sng_TR = 1.8 # reacceleration stop and go TR self.sng_speed = 18.0 * CV.MPH_TO_MS self._setup_changing_variables() # dp params self.last_ts = 0. self.dp_dynamic_follow = PROFILE_OFF self.dp_last_modified = None self.params = Params()
def __init__(self, op_params, is_df=False): self.op_params = op_params self.is_df = is_df self.df_profiles = dfProfiles() self.sm = messaging_arne.SubMaster( ['dynamicFollowButton', 'dynamicFollowData']) self.cur_user_profile = self.op_params.get( 'dynamic_follow', default='auto').strip().lower() if not isinstance( self.cur_user_profile, str) or self.cur_user_profile not in self.df_profiles.to_idx: self.cur_user_profile = self.df_profiles.normal # relaxed else: self.cur_user_profile = self.df_profiles.to_idx[ self.cur_user_profile] self.cur_model_profile = 0 self.alert_duration = 2.0 self.offset = self.cur_user_profile self.profile_pred = None self.change_time = sec_since_boot() self.first_run = True self.last_is_auto = False
def __init__(self, mpc_id): self.mpc_id = mpc_id self.op_params = opParams() self.df_profiles = dfProfiles() self.df_manager = dfManager() self.dmc_v_rel = DistanceModController(k_i=0.042, k_d=0.08, x_clip=[-1, 0, 0.66], mods=[1.15, 1., 0.95]) self.dmc_a_rel = DistanceModController( k_i=0.042 * 1.05, k_d=0.08, x_clip=[-1, 0, 0.33], mods=[1.15, 1., 0.98]) # a_lead loop is 5% faster if not travis and mpc_id == 1: self.pm = messaging.PubMaster(['dynamicFollowData']) else: self.pm = None # Model variables mpc_rate = 1 / 20. self.model_scales = { 'v_ego': [-0.06112159043550491, 37.96522521972656], 'a_lead': [-3.109330892562866, 3.3612186908721924], 'v_lead': [0.0, 35.27671432495117], 'x_lead': [2.4600000381469727, 141.44000244140625] } self.predict_rate = 1 / 4. self.skip_every = round(0.25 / mpc_rate) self.model_input_len = round(45 / mpc_rate) # Dynamic follow variables self.default_TR = 1.8 self.TR = 1.8 self.v_ego_retention = 2.5 self.v_rel_retention = 1.75 #self.sng_TR = 1.8 # reacceleration stop and go TR #Orig #self.sng_TR = 2.3 # Last value #self.sng_TR = 1.5 # Try to decrease stop and start TR so would start move faster from stop self.sng_TR = 1. # Try to decrease stop and start TR so would start move faster from stop self.sng_TR = 2.5 # Maybe I thought this wrong self.sng_speed = 18.0 * CV.MPH_TO_MS #Orig #self.sng_speed = 12.0 * CV.MPH_TO_MS self._setup_collector() self._setup_changing_variables()