本文整理汇总了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