Skip to content

Commit

Permalink
Add test for zero magnetic field in estimator Tilt.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayitzin committed Oct 21, 2024
1 parent a93ee14 commit f5c2bed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ def test_wrong_input_vector_types(self):
self.assertRaises(TypeError, ahrs.filters.Tilt, acc=['1.0', '2.0', '3.0'], mag=[2.0, 3.0, 4.0])
self.assertRaises(TypeError, ahrs.filters.Tilt, acc=[1.0, 2.0, 3.0], mag=['2.0', '3.0', '4.0'])

def test_zero_magnetic_field(self):
self.assertRaises(ValueError, ahrs.filters.Tilt, acc=self.accelerometers[0], mag=np.zeros(3))
tilt = ahrs.filters.Tilt()
self.assertRaises(ValueError, tilt.estimate, acc=self.accelerometers[0], mag=np.zeros(3))

def test_wrong_representation(self):
self.assertRaises(TypeError, ahrs.filters.Tilt, representation=1)
self.assertRaises(TypeError, ahrs.filters.Tilt, acc=self.accelerometers, mag=self.magnetometers, representation=1)
Expand Down

0 comments on commit f5c2bed

Please sign in to comment.