當前位置: 首頁>>代碼示例>>Python>>正文


Python Vehicle.set_parameters方法代碼示例

本文整理匯總了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
開發者ID:meco-group,項目名稱:omg-tools,代碼行數:9,代碼來源:quadrotor.py

示例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
開發者ID:meco-group,項目名稱:omg-tools,代碼行數:9,代碼來源:holonomic.py

示例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
開發者ID:meco-group,項目名稱:omg-tools,代碼行數:13,代碼來源:holonomicorient.py

示例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
開發者ID:meco-group,項目名稱:omg-tools,代碼行數:15,代碼來源:quadrotor3d.py

示例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
開發者ID:meco-group,項目名稱:omg-tools,代碼行數:15,代碼來源:quadrotor3d_simple.py

示例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
開發者ID:meco-group,項目名稱:omg-tools,代碼行數:18,代碼來源:trailer.py

示例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
開發者ID:meco-group,項目名稱:omg-tools,代碼行數:26,代碼來源:bicycle.py


注:本文中的vehicle.Vehicle.set_parameters方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。