8000 isvalid checks it's actually an array · suddrey-qut/spatialmath-python@c6f65e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit c6f65e0

Browse files
committed
isvalid checks it's actually an array
1 parent 9fa4fdf commit c6f65e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spatialmath/base/transforms2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def ishom2(T, check=False):
188188
189189
:seealso: isR, isrot2, ishom, isvec
190190
"""
191-
return T.shape == (3, 3) and (not check or (trn.isR(T[:2, :2]) and np.all(T[2, :] == np.array([0, 0, 1]))))
191+
return isinstance(T, np.ndarray) and T.shape == (3, 3) and (not check or (trn.isR(T[:2, :2]) and np.all(T[2, :] == np.array([0, 0, 1]))))
192192

193193

194194
def isrot2(R, check=False):
@@ -207,7 +207,7 @@ def isrot2(R, check=False):
207207
208208
:seealso: isR, ishom2, isrot
209209
"""
210-
return R.shape == (2, 2) and (not check or trn.isR(R))
210+
return isinstance(R, np.ndarray) and R.shape == (2, 2) and (not check or trn.isR(R))
211211

212212

213213
# ---------------------------------------------------------------------------------------#

0 commit comments

Comments
 (0)
0