diff --git a/spatialmath/base/animate.py b/spatialmath/base/animate.py index effcd52b..59b98887 100755 --- a/spatialmath/base/animate.py +++ b/spatialmath/base/animate.py @@ -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)