本文整理匯總了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