66JointType = IntFlag ('JointType' , 'revolute prismatic revolute_theda revolute_alpha' )
77mdh_params = namedtuple ("mdh_params" , "alpha a theta d type" )
88
9- @attr .s
10- class Link :
11- """
12- why? what is the value of this?
13- prismatic/revolute have parameters that never chance ... need to freeze them!
14- """
15- # alpha = attr.ib(type=float)
16- # a = attr.ib(type=float)
17- # theta = attr.ib(type=float)
18- # d = attr.ib(type=float)
9+ # @attr.s
10+ # class Link:
11+ # """
12+ # why? what is the value of this?
13+ # prismatic/revolute have parameters that never chance ... need to freeze them!
14+ # """
15+ # # alpha = attr.ib(type=float)
16+ # # a = attr.ib(type=float)
17+ # # theta = attr.ib(type=float)
18+ # # d = attr.ib(type=float)
1919
20- @attr .s
21- class RevoluteLink ( Link ) :
20+ @attr .s ( slots = True )
21+ class RevoluteLink :
2222 """
2323 RevoluteLink about theta. All other parameters (alpha, a, d) are fixed and
2424 cannot be changed once the link is created.
@@ -27,6 +27,8 @@ class RevoluteLink(Link):
2727 _a = attr .ib (type = float )
2828 theta = attr .ib (type = float )
2929 _d = attr .ib (type = float )
30+ min = attr .ib (- np .pi , type = float )
31+ max = attr .ib (np .pi , type = float )
3032
3133 @property
3234 def alpha (self ) -> float :
@@ -40,9 +42,9 @@ def a(self) -> float:
4042 def d (self ) -> float :
4143 return self ._d
4244
43- # max/min limits of link for optimzation
44- min = attr . ib ( - np . pi , type = float )
45- max = attr . ib ( np . pi , type = float )
45+ @ property
46+ def type ( self ):
47+ return JointType . revolute
4648
4749 """Some of these params are immutable, how do I do that?"""
4850 def transform (self , angle : float ):
@@ -69,7 +71,11 @@ def transform(self, angle: float):
6971
7072 return transform
7173
72- @attr .s
73- class Prismatic (Link ):
74- min = attr .ib (type = float )
75- max = attr .ib (type = float )
74+ # @attr.s
75+ # class Prismatic:
76+ # min = attr.ib(type=float)
77+ # max = attr.ib(type=float)
78+ #
79+ # @property
80+ # def type(self):
81+ # return JointType.revolute
0 commit comments