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


Python UasTelemetry.closest_interpolated_distance方法代碼示例

本文整理匯總了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)
開發者ID:legonigel,項目名稱:interop,代碼行數:30,代碼來源:uas_telemetry_test.py


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