本文整理匯總了Python中auvsi_suas.models.uas_telemetry.UasTelemetry.closest_interpolated_distance方法的典型用法代碼示例。如果您正苦於以下問題:Python UasTelemetry.closest_interpolated_distance方法的具體用法?Python UasTelemetry.closest_interpolated_distance怎麽用?Python UasTelemetry.closest_interpolated_distance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類auvsi_suas.models.uas_telemetry.UasTelemetry
的用法示例。
在下文中一共展示了UasTelemetry.closest_interpolated_distance方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_closest_interpolated_distance
# 需要導入模塊: from auvsi_suas.models.uas_telemetry import UasTelemetry [as 別名]
# 或者: from auvsi_suas.models.uas_telemetry.UasTelemetry import closest_interpolated_distance [as 別名]
def test_closest_interpolated_distance(self):
utm = distance.proj_utm(zone=18, north=True)
# Test velocity filter.
waypoint = self.waypoints_from_data([(38, -76, 100)])[0]
entries = [(38, -76, 140), (40, -78, 600)]
logs = self.create_uas_logs(self.user, entries)
d = UasTelemetry.closest_interpolated_distance(logs[0], logs[1],
waypoint, utm)
self.assertAlmostEqual(40.0, d, delta=3)
# Test telemetry rate filter.
waypoint = self.waypoints_from_data([(38.145147, -76.427583, 100)])[0]
entries = [(38.145148, -76.427645, 100), (38.145144, -76.427400, 100)]
logs = self.create_uas_logs(self.user, entries)
logs[1].timestamp = logs[0].timestamp + datetime.timedelta(seconds=2)
d = UasTelemetry.closest_interpolated_distance(logs[0], logs[1],
waypoint, utm)
self.assertAlmostEqual(17.792, d, delta=3)
# Test interpolation (waypoint is halfway between telemetry logs).
waypoint = self.waypoints_from_data([(38.145146, -76.427522, 80)])[0]
entries = [(38.145148, -76.427645, 100), (38.145144, -76.427400, 100)]
logs = self.create_uas_logs(self.user, entries)
logs[1].timestamp = logs[0].timestamp + datetime.timedelta(seconds=1)
d = UasTelemetry.closest_interpolated_distance(logs[0], logs[1],
waypoint, utm)
self.assertAlmostEqual(20.0, d, delta=3)