Skip to content

Commit

Permalink
Add tests for euler angles equal to 0 or factors of 2*pi in DCM.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayitzin committed Oct 18, 2024
1 parent 92ab447 commit 9f6e068
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_dcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ def test_rotation_matrix_from_euler_angles(self):

def test_identity_rotation_matrix(self):
np.testing.assert_equal(self.R0, np.identity(3))
np.testing.assert_equal(ahrs.DCM(), np.identity(3))
np.testing.assert_equal(ahrs.DCM(x=0.0), np.identity(3))
np.testing.assert_equal(ahrs.DCM(y=0.0), np.identity(3))
np.testing.assert_equal(ahrs.DCM(z=0.0), np.identity(3))
np.testing.assert_almost_equal(ahrs.DCM(x=360.0*ahrs.DEG2RAD), np.identity(3))
np.testing.assert_almost_equal(ahrs.DCM(y=360.0*ahrs.DEG2RAD), np.identity(3))
np.testing.assert_almost_equal(ahrs.DCM(z=360.0*ahrs.DEG2RAD), np.identity(3))

def test_wrong_input_matrix(self):
self.assertRaises(TypeError, ahrs.DCM, 3)
Expand Down

0 comments on commit 9f6e068

Please sign in to comment.