Skip to content

Commit 3262923

Browse files
committed
add handling for unexpected frame type for completeness
1 parent dabbcf6 commit 3262923

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy