Skip to content

Commit

Permalink
add handling for unexpected frame type for completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
jcao-bdai committed Jul 22, 2024
1 parent dabbcf6 commit 2e32897
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spatialmath/base/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,12 @@ def update(frame, animation):
if isinstance(frame, float):
# passed a single transform, interpolate it
T = smb.trinterp(start=self.start, end=self.end, s=frame)
else:
# assume it is an SO(3) or SE(3)
elif isinstance(frame, NDArray):
# type is SO3Array or SE3Array when Animate.trajectory is not None
T = frame
# ensure result is SE(3)
else:
# other types, attempt to convert
T = np.array(frame)

if T.shape == (3, 3):
T = smb.r2t(T)
Expand Down

0 comments on commit 2e32897

Please sign in to comment.