diff --git a/evo/tools/tf_cache.py b/evo/tools/tf_cache.py index 2a0cce6..8a39131 100644 --- a/evo/tools/tf_cache.py +++ b/evo/tools/tf_cache.py @@ -24,8 +24,14 @@ import math import warnings from collections import defaultdict -from typing import (DefaultDict, List, Optional, Protocol, Union, - runtime_checkable) +from typing import ( + DefaultDict, + List, + Optional, + Protocol, + Union, + runtime_checkable, +) import numpy as np import tf2_py @@ -60,6 +66,9 @@ def to_sec(self) -> float: Gets scalar time, in seconds. """ + def __lt__(self, other) -> bool: + """ less-than comparator, required for sorting """ + @runtime_checkable class Ros2TimeLike(Protocol): # pylint: disable=too-few-public-methods @@ -72,6 +81,9 @@ def nanoseconds(self) -> int: Gets underlying scalar timestamp, in nanoseconds. """ + def __lt__(self, other) -> bool: + """ less-than comparator, required for sorting """ + @runtime_checkable class Ros2StampLike(Protocol): # pylint: disable=too-few-public-methods