Skip to content

Commit 1057abf

Browse files
authored
SE3: accept a stacked (N, 4, 4) array and say what is accepted in the error
Added support for SE3 constructor with (N, 4, 4) NumPy array.
1 parent 73222bf commit 1057abf

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎spatialmath/pose3d.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,9 @@ def __init__(self, x=None, y=None, z=None, *, check=True):
10961096
- ``SE3([X1, X2, ... XN])`` has ``N`` values
10971097
given by the elements ``Xi`` each of which is an SE3 instance.
10981098
1099+
- ``SE3(A)`` where ``A`` is an ``(N, 4, 4)`` NumPy array has ``N`` values,
1100+
equivalent to ``SE3(list(A))``.
1101+
10991102
:SymPy: supported
11001103
"""
11011104
if y is None and z is None:
@@ -1115,7 +1118,10 @@ def __init__(self, x=None, y=None, z=None, *, check=True):
11151118
self.data = [smb.transl(T) for T in x]
11161119

11171120
else:
1118-
raise ValueError("bad argument to constructor")
1121+
raise ValueError(
1122+
"bad argument to constructor: expected an SE3, SO3 or SE2 instance, a 4x4 or "
1123+
"(N, 4, 4) array, a list of those, a 3-vector or an (N, 3) array of translations"
1124+
)
11191125

11201126
elif y is not None and z is not None:
11211127
# SE3(x, y, z)

0 commit comments

Comments
 (0)