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


Python AerialPosition.distanceTo方法代碼示例

本文整理匯總了Python中auvsi_suas.models.AerialPosition.distanceTo方法的典型用法代碼示例。如果您正苦於以下問題:Python AerialPosition.distanceTo方法的具體用法?Python AerialPosition.distanceTo怎麽用?Python AerialPosition.distanceTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在auvsi_suas.models.AerialPosition的用法示例。


在下文中一共展示了AerialPosition.distanceTo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: eval_distanceTo_input

# 需要導入模塊: from auvsi_suas.models import AerialPosition [as 別名]
# 或者: from auvsi_suas.models.AerialPosition import distanceTo [as 別名]
 def eval_distanceTo_input(self, lon1, lat1, alt1, lon2, lat2, alt2,
         dist_actual):
     """Evaluates the distanceTo calc with the given inputs."""
     pos1 = AerialPosition()
     pos1.gps_position = GpsPosition()
     pos1.gps_position.latitude = lat1
     pos1.gps_position.longitude = lon1
     pos1.altitude_msl = alt1
     pos2 = AerialPosition()
     pos2.gps_position = GpsPosition()
     pos2.gps_position.latitude = lat2
     pos2.gps_position.longitude = lon2
     pos2.altitude_msl = alt2
     dist12 = pos1.distanceTo(pos2)
     dist21 = pos2.distanceTo(pos1)
     dist_actual_ft = kilometersToFeet(dist_actual)
     diffdist12 = abs(dist12 - dist_actual_ft)
     diffdist21 = abs(dist21 - dist_actual_ft)
     dist_thresh = 10.0
     return diffdist12 <= dist_thresh and diffdist21 <= dist_thresh
開發者ID:UCR-UAS,項目名稱:auvsi_suas_competition,代碼行數:22,代碼來源:tests.py


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