@@ -194,3 +194,28 @@ def test__update_quaternion_with_gibbs2(quaternion, da, quaternion_update_expect
194194 np .testing .assert_allclose (
195195 quaternion_update , quaternion_update_expected , atol = 1e-10
196196 )
197+
198+
199+ @pytest .mark .parametrize (
200+ "q_nb,nav_frame_factor" ,
201+ [
202+ (np .array ([1.0 , 0.0 , 0.0 , 0.0 ]), 1.0 ),
203+ (np .array ([1.0 , 0.0 , 0.0 , 0.0 ]), - 1.0 ),
204+ (np .array ([np .cos (0.1 / 2 ), np .sin (0.1 / 2 ), 0.0 , 0.0 ]), - 1.0 ),
205+ (np .array ([np .cos (0.1 / 2 ), np .sin (0.1 / 2 ), 0.0 , 0.0 ]), 1.0 ),
206+ (np .array ([np .cos (0.1 / 2 ), 0.0 , np .sin (0.1 / 2 ), 0.0 ]), - 1.0 ),
207+ (np .array ([np .cos (0.1 / 2 ), 0.0 , np .sin (0.1 / 2 ), 0.0 ]), 1.0 ),
208+ (np .array ([np .cos (0.1 / 2 ), 0.0 , 0.0 , np .sin (0.1 / 2 )]), - 1.0 ),
209+ (np .array ([np .cos (0.1 / 2 ), 0.0 , 0.0 , np .sin (0.1 / 2 )]), 1.0 )
210+ ]
211+ )
212+ def test__nz_b_from_quat (q_nb , nav_frame_factor ):
213+ out = _common ._nz_b_from_quat (q_nb , nav_frame_factor = nav_frame_factor )
214+
215+ expect = Rotation .from_quat (q_nb , scalar_first = True ).apply (nav_frame_factor * np .array ([0.0 , 0.0 , 1.0 ]), inverse = True )
216+ np .testing .assert_allclose (out , expect )
217+
218+
219+ def test__nz2vg ():
220+ assert _common ._nz2vg ("NED" ) == 1.0
221+ assert _common ._nz2vg ("ENU" ) == - 1.0
0 commit comments