Skip to content

Commit cc7398f

Browse files
committed
add handling for unexpected frame type for completeness
1 parent 7d58fdd commit cc7398f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spatialmath/base/animate.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ def update(frame, animation):
214214
if isinstance(frame, float):
215215
# passed a single transform, interpolate it
216216
T = smb.trinterp(start=self.start, end=self.end, s=frame)
217-
else:
218-
# assume it is an SO(3) or SE(3)
217+
elif isinstance(frame, NDArray):
218+
# type is SO3Array or SE3Array when Animate.trajectory is not None
219219
T = frame
220-
# ensure result is SE(3)
220+
else:
221+
# [unlikely] other types are converted to np array
222+
T = np.array(frame)
221223

222224
if T.shape == (3, 3):
223225
T = smb.r2t(T)

0 commit comments

Comments
 (0)