Skip to content

Commit cd515ac

Browse files
committed
use smb instead of base throughout
1 parent 30ee4e6 commit cd515ac

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

‎spatialmath/base/animate.py‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import numpy as np
1414
import matplotlib.pyplot as plt
1515
from matplotlib import animation
16-
from spatialmath import base
16+
import spatialmath.base as smb
1717
from collections.abc import Iterable, Iterator
1818
from spatialmath.base.types import *
1919

@@ -140,21 +140,21 @@ def trplot(
140140
self.trajectory = end
141141

142142
# stash the final value
143-
if base.isrot(end):
144-
self.end = base.r2t(end)
143+
if smb.isrot(end):
144+
self.end = smb.r2t(end)
145145
else:
146146
self.end = end
147147

148148
if start is None:
149149
self.start = np.identity(4)
150150
else:
151-
if base.isrot(start):
152-
self.start = base.r2t(start)
151+
if smb.isrot(start):
152+
self.start = smb.r2t(start)
153153
else:
154154
self.start = start
155155

156156
# draw axes at the origin
157-
base.trplot(self.start, ax=self, **kwargs)
157+
smb.trplot(self.start, ax=self, **kwargs)
158158

159159
def set_proj_type(self, proj_type: str):
160160
self.ax.set_proj_type(proj_type)
@@ -205,14 +205,14 @@ def update(frame, animation):
205205

206206
if isinstance(frame, float):
207207
# passed a single transform, interpolate it
208-
T = base.trinterp(start=self.start, end=self.end, s=frame)
208+
T = smb.trinterp(start=self.start, end=self.end, s=frame)
209209
else:
210210
# assume it is an SO(3) or SE(3)
211211
T = frame
212212

213213
# ensure result is SE(3)
214214
if T.shape == (3, 3):
215-
T = base.r2t(T)
215+
T = smb.r2t(T)
216216

217217
# update the scene
218218
animation._draw(T)
@@ -580,21 +580,21 @@ def trplot2(
580580
self.trajectory = end
581581

582582
# stash the final value
583-
if base.isrot2(end):
584-
self.end = base.r2t(end)
583+
if smb.isrot2(end):
584+
self.end = smb.r2t(end)
585585
else:
586586
self.end = end
587587

588588
if start is None:
589589
self.start = np.identity(3)
590590
else:
591-
if base.isrot2(start):
592-
self.start = base.r2t(start)
591+
if smb.isrot2(start):
592+
self.start = smb.r2t(start)
593593
else:
594594
self.start = start
595595

596596
# draw axes at the origin
597-
base.trplot2(self.start, ax=self, block=False, **kwargs)
597+
smb.trplot2(self.start, ax=self, block=False, **kwargs)
598598

599599
def run(
600600
self, movie=None, axes=None, repeat=False, interval=50, nframes=100, **kwargs
@@ -757,7 +757,7 @@ def __init__(self, anim, h, x, y, u, v):
757757
self.p = np.c_[u - x, v - y].T
758758

759759
def draw(self, T):
760-
R, t = base.tr2rt(T)
760+
R, t = smb.tr2rt(T)
761761
p = R @ self.p
762762
# specific to a single Quiver
763763
self.h.set_offsets(t) # shift the origin

0 commit comments

Comments
 (0)