Skip to content

Commit 6dc40ae

Browse files
committed
[Issue-126] fix several issues with animate
1 parent 6074eb7 commit 6dc40ae

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

spatialmath/base/animate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def __init__(self, anim: Animate, h, xs, ys, zs):
309309
self.anim = anim
310310

311311
def draw(self, T):
312-
p = T.A @ self.p
312+
p = T @ self.p
313313
self.h.set_data(p[0, :], p[1, :])
314314
self.h.set_3d_properties(p[2, :])
315315

@@ -367,7 +367,7 @@ def __init__(self, anim, h):
367367

368368
def draw(self, T):
369369
# import ipdb; ipdb.set_trace()
370-
p = T.A @ self.p
370+
p = T @ self.p
371371

372372
# reshape it
373373
p = p[0:3, :].T.reshape(3, 2, 3)
@@ -421,7 +421,7 @@ def __init__(self, anim, h, x, y, z):
421421
self.anim = anim
422422

423423
def draw(self, T):
424-
p = T.A @ self.p
424+
p = T @ self.p
425425
# x2, y2, _ = proj3d.proj_transform(
426426
# p[0], p[1], p[2], self.anim.ax.get_proj())
427427
# self.h.set_position((x2, y2))

spatialmath/base/transforms2d.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,12 +1510,11 @@ def tranimate2(T: Union[SO2Array, SE2Array], **kwargs):
15101510
tranimate2(transl(1,2)@trot2(1), frame='A', arrow=False, dims=[0, 5])
15111511
tranimate2(transl(1,2)@trot2(1), frame='A', arrow=False, dims=[0, 5], movie='spin.mp4')
15121512
"""
1513-
anim = smb.animate.Animate2(**kwargs)
1514-
try:
1513+
if "dims" in kwargs:
1514+
kwargs["dim"] = kwargs["dims"]
15151515
del kwargs["dims"]
1516-
except KeyError:
1517-
pass
15181516

1517+
anim = smb.animate.Animate2(**kwargs)
15191518
anim.trplot2(T, **kwargs)
15201519
return anim.run(**kwargs)
15211520

spatialmath/base/transforms3d.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3409,12 +3409,11 @@ def tranimate(T: Union[SO3Array, SE3Array], **kwargs) -> str:
34093409
34103410
:seealso: `trplot`, `plotvol3`
34113411
"""
3412-
anim = Animate(**kwargs)
3413-
try:
3412+
if "dims" in kwargs:
3413+
kwargs["dim"] = kwargs["dims"]
34143414
del kwargs["dims"]
3415-
except KeyError:
3416-
pass
34173415

3416+
anim = Animate(**kwargs)
34183417
anim.trplot(T, **kwargs)
34193418
return anim.run(**kwargs)
34203419

0 commit comments

Comments
 (0)