本文整理汇总了Python中vehicle.Vehicle.set_parameters方法的典型用法代码示例。如果您正苦于以下问题:Python Vehicle.set_parameters方法的具体用法?Python Vehicle.set_parameters怎么用?Python Vehicle.set_parameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vehicle.Vehicle
的用法示例。
在下文中一共展示了Vehicle.set_parameters方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_parameters
# 需要导入模块: from vehicle import Vehicle [as 别名]
# 或者: from vehicle.Vehicle import set_parameters [as 别名]
def set_parameters(self, current_time):
parameters = Vehicle.set_parameters(self, current_time)
parameters[self]['spl0'] = self.prediction['state'][:2]
parameters[self]['dspl0'] = self.prediction['dspl']
parameters[self]['ddspl0'] = self.prediction['ddspl']
parameters[self]['poseT'] = self.poseT
return parameters
示例2: set_parameters
# 需要导入模块: from vehicle import Vehicle [as 别名]
# 或者: from vehicle.Vehicle import set_parameters [as 别名]
def set_parameters(self, current_time):
parameters = Vehicle.set_parameters(self, current_time)
parameters[self]['state0'] = self.prediction['state']
parameters[self]['input0'] = self.prediction['input']
# parameters[self]['dinput0'] = self.prediction['dinput']
parameters[self]['poseT'] = self.poseT
return parameters
示例3: set_parameters
# 需要导入模块: from vehicle import Vehicle [as 别名]
# 或者: from vehicle.Vehicle import set_parameters [as 别名]
def set_parameters(self, current_time):
# for the optimization problem
# convert theta to tg_ha here
parameters = Vehicle.set_parameters(self, current_time)
parameters[self]['pos0'] = self.prediction['state'][:2] # x, y
parameters[self]['tg_ha0'] = np.tan(self.prediction['state'][2]/2)
parameters[self]['vel0'] = self.prediction['input'][:2] # dx, dy
parameters[self]['dtg_ha0'] = 0.5*self.prediction['input'][2]*(1+parameters[self]['tg_ha0']**2)
parameters[self]['posT'] = self.poseT[:2] # x, y
parameters[self]['tg_haT'] = np.tan(self.poseT[2]/2)
return parameters
示例4: set_parameters
# 需要导入模块: from vehicle import Vehicle [as 别名]
# 或者: from vehicle.Vehicle import set_parameters [as 别名]
def set_parameters(self, current_time):
parameters = Vehicle.set_parameters(self, current_time)
parameters[self]['q_phi0'] = np.tan(self.prediction['state'][6]/2.)
parameters[self]['q_theta0'] = np.tan(self.prediction['state'][7]/2.)
parameters[self]['f_til0'] = self.prediction['input'][0]/((1+parameters[self]['q_phi0']**2)*(1+parameters[self]['q_theta0']**2))
parameters[self]['dq_phi0'] = 0.5*self.prediction['input'][1]*(1+parameters[self]['q_phi0']**2)
parameters[self]['dq_theta0'] = 0.5*self.prediction['input'][2]*(1+parameters[self]['q_theta0']**2)
parameters[self]['pos0'] = self.prediction['state'][:3]
parameters[self]['dpos0'] = self.prediction['state'][3:6]
parameters[self]['posT'] = self.poseT[:3]
parameters[self]['q_phiT'] = np.tan(self.poseT[3]/2.)
parameters[self]['q_thetaT'] = np.tan(self.poseT[4]/2.)
return parameters
示例5: set_parameters
# 需要导入模块: from vehicle import Vehicle [as 别名]
# 或者: from vehicle.Vehicle import set_parameters [as 别名]
def set_parameters(self, current_time):
parameters = Vehicle.set_parameters(self, current_time)
parameters[self]['spl0'] = self.prediction['state'][:3]
f0 = self.prediction['input'][0]
phi0 = self.prediction['state'][6]
theta0 = self.prediction['state'][7]
ddx0 = f0*np.cos(phi0)*np.sin(theta0)
ddy0 = -f0*np.sin(phi0)
ddz0 = f0*np.cos(phi0)*np.cos(theta0)-self.g
parameters[self]['ddspl0'] = [ddx0, ddy0, ddz0]
parameters[self]['dspl0'] = self.prediction['state'][3:6]
parameters[self]['positionT'] = self.positionT
return parameters
示例6: set_parameters
# 需要导入模块: from vehicle import Vehicle [as 别名]
# 或者: from vehicle.Vehicle import set_parameters [as 别名]
def set_parameters(self, current_time):
# pred of leading vehicle is not simulated separately
pred_veh = {}
pred_veh['input'] = self.prediction['input']
pred_veh['state'] = self.prediction['state'][3:, ]
self.lead_veh.update_prediction(pred_veh)
parameters = Vehicle.set_parameters(self, current_time)
parameters_tr = {}
parameters_tr['tg_ha_tr0'] = np.tan(self.prediction['state'][2]/2.)
parameters_tr['dtg_ha_tr0'] = 0.5*self.prediction['input'][0]/self.l_hitch*(np.sin(self.prediction['state'][5]-self.prediction['state'][2]))*(1+parameters_tr['tg_ha_tr0']**2) # dtg_ha
if hasattr(self, 'theta_trT'):
parameters_tr['tg_ha_trT'] = np.tan(self.theta_trT/2.)
parameters_veh = self.lead_veh.set_parameters(current_time)
parameters[self].update(parameters_tr)
parameters[self].update(parameters_veh[self.lead_veh])
return parameters
示例7: set_parameters
# 需要导入模块: from vehicle import Vehicle [as 别名]
# 或者: from vehicle.Vehicle import set_parameters [as 别名]
def set_parameters(self, current_time):
# for the optimization problem
parameters = Vehicle.set_parameters(self, current_time)
parameters[self]['tg_ha0'] = np.tan(self.prediction['state'][2]/2)
parameters[self]['v_til0'] = self.prediction['input'][0]/(1+parameters[self]['tg_ha0']**2)
parameters[self]['pos0'] = self.prediction['state'][:2]
parameters[self]['posT'] = self.poseT[:2] # x, y
parameters[self]['v_tilT'] = 0.
parameters[self]['dv_tilT'] = 0.
parameters[self]['tg_haT'] = np.tan(self.poseT[2]/2)
parameters[self]['dtg_haT'] = 0.
parameters[self]['ddtg_haT'] = 0.
# parameters['tdeltaT'] = np.tan(self.poseT[3])
if (parameters[self]['v_til0'] <= 1e-4): # use l'Hopital's rule
parameters[self]['hop0'] = 1.
parameters[self]['v_til0'] = 0. # put exactly = 0.
parameters[self]['dtg_ha0'] = 0. # otherwise you don't get 0./0.
parameters[self]['tdelta0'] = np.tan(self.prediction['state'][3])
else: # no need for l'Hopital's rule
parameters[self]['hop0'] = 0.
parameters[self]['dtg_ha0'] = np.tan(self.prediction['state'][3])*parameters[self]['v_til0']* \
(1+parameters[self]['tg_ha0']**2)**2/(2*self.length)
# tdelta0 is only used when hop0 = 1, so no need to assign here
return parameters