File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 6
6
"""
7
7
8
8
from collections import UserList
9
- from functools import lru_cache , cached_property
10
9
from numpy import (
11
10
pi ,
12
11
where ,
44
43
from spatialmath .base import getvector
45
44
from spatialmath import SE3
46
45
from typing import Union , overload , List , Set
46
+ from sys import version_info
47
47
48
48
ArrayLike = Union [list , ndarray , tuple , set ]
49
49
50
+ py_ver = version_info
51
+
52
+ if version_info >= (3 , 9 ):
53
+ from functools import cached_property
54
+
55
+ c_property = cached_property
56
+ else :
57
+ c_property = property
58
+
50
59
51
60
class BaseETS (UserList ):
52
61
def __init__ (self , * args ):
@@ -238,7 +247,7 @@ def jindex_set(self) -> Set[int]: #
238
247
"""
239
248
return set ([self [j ].jindex for j in self .joint_idx ()]) # type: ignore
240
249
241
- @cached_property
250
+ @c_property
242
251
def jindices (self ) -> ndarray :
243
252
"""
244
253
Get an array of joint indices
@@ -255,7 +264,7 @@ def jindices(self) -> ndarray:
255
264
"""
256
265
return array ([self [j ].jindex for j in self .joints ()]) # type: ignore
257
266
258
- @cached_property
267
+ @c_property
259
268
def qlim (self ):
260
269
r"""
261
270
Joint limits
You can’t perform that action at this time.
0 commit comments