@@ -704,8 +704,10 @@ def manipulability(
704
704
J : None = None ,
705
705
end : Union [str , Link , Gripper , None ] = None ,
706
706
start : Union [str , Link , Gripper , None ] = None ,
707
- method : L ["yoshikawa" , "asada" , "minsingular" , "invcondition" ] = "yoshikawa" ,
708
- axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" ,
707
+ method : L [
708
+ "yoshikawa" , "asada" , "minsingular" , "invcondition" # noqa
709
+ ] = "yoshikawa" ,
710
+ axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" , # noqa
709
711
** kwargs ,
710
712
) -> Union [float , NDArray ]: # pragma nocover
711
713
...
@@ -717,8 +719,10 @@ def manipulability(
717
719
J : NDArray = ...,
718
720
end : Union [str , Link , Gripper , None ] = None ,
719
721
start : Union [str , Link , Gripper , None ] = None ,
720
- method : L ["yoshikawa" , "asada" , "minsingular" , "invcondition" ] = "yoshikawa" ,
721
- axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" ,
722
+ method : L [
723
+ "yoshikawa" , "asada" , "minsingular" , "invcondition" # noqa
724
+ ] = "yoshikawa" ,
725
+ axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" , # noqa
722
726
** kwargs ,
723
727
) -> Union [float , NDArray ]: # pragma nocover
724
728
...
@@ -729,8 +733,10 @@ def manipulability(
729
733
J = None ,
730
734
end : Union [str , Link , Gripper , None ] = None ,
731
735
start : Union [str , Link , Gripper , None ] = None ,
732
- method : L ["yoshikawa" , "asada" , "minsingular" , "invcondition" ] = "yoshikawa" ,
733
- axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" ,
736
+ method : L [
737
+ "yoshikawa" , "asada" , "minsingular" , "invcondition" # noqa
738
+ ] = "yoshikawa" ,
739
+ axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" , # noqa
734
740
** kwargs ,
735
741
):
736
742
"""
@@ -893,6 +899,10 @@ def asada(robot, J, q, axes_list):
893
899
894
900
# Otherwise use the q vector/matrix
895
901
else :
902
+ if q is None :
903
+ raise ValueError ("Either J or q must be supplied" )
904
+
905
+ q = getmatrix (q , (None , self .n ))
896
906
q = np .array (getmatrix (q , (None , self .n )))
897
907
w = np .zeros (q .shape [0 ])
898
908
@@ -957,7 +967,9 @@ def jacob0_dot(
957
967
q : ArrayLike ,
958
968
qd : ArrayLike ,
959
969
J0 : None = None ,
960
- representation : Union [L ["rpy/xyz" , "rpy/zyx" , "eul" , "exp" ], None ] = None ,
970
+ representation : Union [
971
+ L ["rpy/xyz" , "rpy/zyx" , "eul" , "exp" ], None # noqa
972
+ ] = None ,
961
973
) -> NDArray : # pragma no cover
962
974
...
963
975
@@ -967,7 +979,9 @@ def jacob0_dot(
967
979
q : None ,
968
980
qd : ArrayLike ,
969
981
J0 : NDArray = ...,
970
- representation : Union [L ["rpy/xyz" , "rpy/zyx" , "eul" , "exp" ], None ] = None ,
982
+ representation : Union [
983
+ L ["rpy/xyz" , "rpy/zyx" , "eul" , "exp" ], None # noqa
984
+ ] = None ,
971
985
) -> NDArray : # pragma no cover
972
986
...
973
987
@@ -976,7 +990,9 @@ def jacob0_dot(
976
990
q ,
977
991
qd : ArrayLike ,
978
992
J0 = None ,
979
- representation : Union [L ["rpy/xyz" , "rpy/zyx" , "eul" , "exp" ], None ] = None ,
993
+ representation : Union [
994
+ L ["rpy/xyz" , "rpy/zyx" , "eul" , "exp" ], None # noqa
995
+ ] = None ,
980
996
):
981
997
r"""
982
998
Derivative of Jacobian
@@ -1083,7 +1099,7 @@ def jacobm(
1083
1099
H : None = None ,
1084
1100
end : Union [str , Link , Gripper , None ] = None ,
1085
1101
start : Union [str , Link , Gripper , None ] = None ,
1086
- axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" ,
1102
+ axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" , # noqa
1087
1103
) -> NDArray : # pragma no cover
1088
1104
...
1089
1105
@@ -1095,7 +1111,7 @@ def jacobm(
1095
1111
H : NDArray = ...,
1096
1112
end : Union [str , Link , Gripper , None ] = None ,
1097
1113
start : Union [str , Link , Gripper , None ] = None ,
1098
- axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" ,
1114
+ axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" , # noqa
1099
1115
) -> NDArray : # pragma no cover
1100
1116
...
1101
1117
@@ -1106,7 +1122,7 @@ def jacobm(
1106
1122
H = None ,
1107
1123
end : Union [str , Link , Gripper , None ] = None ,
1108
1124
start : Union [str , Link , Gripper , None ] = None ,
1109
- axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" ,
1125
+ axes : Union [L ["all" , "trans" , "rot" ], List [bool ]] = "all" , # noqa
1110
1126
) -> NDArray :
1111
1127
r"""
1112
1128
The manipulability Jacobian
@@ -1184,8 +1200,12 @@ def jacobm(
1184
1200
1185
1201
if H is None :
1186
1202
H = self .hessian0 (J0 = J , start = start , end = end )
1187
- else :
1188
- verifymatrix (H , (6 , self .n , self .n ))
1203
+ # else:
1204
+ # verifymatrix(H, (6, self.n, self.n))
1205
+ elif not isinstance (H , np .ndarray ):
1206
+ raise TypeError ("Hessian must be numpy array of shape 6xnxn" )
1207
+ elif H .shape != (6 , self .n , self .n ):
1208
+ raise ValueError ("Hessian must be numpy array of shape 6xnxn" )
1189
1209
1190
1210
manipulability = self .manipulability (
1191
1211
q , J = J , start = start , end = end , axes = axes # type: ignore
@@ -1209,7 +1229,11 @@ def jacobm(
1209
1229
1210
1230
def closest_point (
1211
1231
self , q : ArrayLike , shape : Shape , inf_dist : float = 1.0 , skip : bool = False
1212
- ) -> Tuple [Union [int , None ], Union [NDArray , None ], Union [NDArray , None ],]:
1232
+ ) -> Tuple [
1233
+ Union [int , None ],
1234
+ Union [NDArray , None ],
1235
+ Union [NDArray , None ],
1236
+ ]:
1213
1237
"""
1214
1238
Find the closest point between robot and shape
1215
1239
0 commit comments