Skip to content

Commit e668395

Browse files
test clear
1 parent 68d6e59 commit e668395

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/test_smoothing.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ def ains(self):
1818
ains = sf.AidedINS(10.24, x0)
1919
return ains
2020

21+
@pytest.fixture
22+
def smoother(self, ains):
23+
return FixedIntervalSmoother(ains)
24+
2125
def test__init__(self, ains):
2226
smoother = FixedIntervalSmoother(ains)
2327
assert smoother._ains is ains
@@ -34,6 +38,22 @@ def test_ains(self, ains):
3438
smoother = FixedIntervalSmoother(ains)
3539
assert smoother.ains is ains
3640

41+
def test_clear(self, smoother):
42+
smoother.update(
43+
np.zeros(3),
44+
np.zeros(3),
45+
degrees=True,
46+
)
47+
assert smoother.x.size > 0
48+
smoother.clear()
49+
assert smoother.x.size == 0
50+
assert smoother.P.size == 0
51+
assert smoother.position().size == 0
52+
assert smoother.velocity().size == 0
53+
assert smoother.quaternion().size == 0
54+
assert smoother.bias_acc().size == 0
55+
assert smoother.bias_gyro().size == 0
56+
3757
def test_benchmark_ains(self):
3858
# Reference signal
3959
fs = 10.24 # sampling rate in Hz

0 commit comments

Comments
 (0)