File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -1055,6 +1055,13 @@ def qlim(self):
1055
1055
1056
1056
:return: Array of joint limit values
1057
1057
:rtype: ndarray(2,n)
1058
+ :exception ValueError: unset limits for a prismatic joint
1059
+
1060
+ Limits are extracted from the link objects. If joints limits are
1061
+ not set for:
1062
+
1063
+ - a revolute joint [-𝜋. 𝜋] is returned
1064
+ - a prismatic joint an exception is raised
1058
1065
1059
1066
Example:
1060
1067
@@ -1066,15 +1073,24 @@ def qlim(self):
1066
1073
"""
1067
1074
# TODO tidy up
1068
1075
limits = np .zeros ((2 , self .n ))
1069
- for j , link in enumerate (self ):
1070
- if link .qlim is None :
1071
- if link .isrevolute :
1076
+ j = 0
1077
+ for link in self :
1078
+ if link .isrevolute :
1079
+ if link .qlim is None :
1072
1080
v = np .r_ [- np .pi , np .pi ]
1073
1081
else :
1082
+ v = link .qlim
1083
+ elif link .isprismatic :
1084
+ if link .qlim is None :
1074
1085
raise ValueError ('undefined prismatic joint limit' )
1086
+ else :
1087
+ v = link .qlim
1075
1088
else :
1076
- v = link .qlim
1089
+ # fixed link
1090
+ continue
1091
+
1077
1092
limits [:, j ] = v
1093
+ j += 1
1078
1094
return limits
1079
1095
1080
1096
# TODO, the remaining functions, I have only a hazy understanding
You can’t perform that action at this time.
0 commit comments