@@ -66,7 +66,7 @@ def test_benchmark_ains(self):
6666
6767 smoother = sf .FixedIntervalSmoother (ains , cov_smoothing = True )
6868
69- pos_ains , vel_ains , euler_ains = [], [], []
69+ pos_ains , vel_ains , euler_ains , err_ains = [], [], [], []
7070 for f_i , w_i , p_i , h_i in zip (acc_imu , gyro_imu , pos_aid , head_aid ):
7171 smoother .update (
7272 f_i ,
@@ -82,16 +82,19 @@ def test_benchmark_ains(self):
8282 pos_ains .append (smoother .ains .position ())
8383 vel_ains .append (smoother .ains .velocity ())
8484 euler_ains .append (smoother .ains .euler (degrees = True ))
85+ err_ains .append (smoother .ains .P .diagonal ())
8586
8687 # Forward filter state estimates
8788 pos_ains = np .array (pos_ains )
8889 vel_ains = np .array (vel_ains )
8990 euler_ains = np .array (euler_ains )
91+ err_ains = np .array (err_ains )
9092
9193 # Smoothed state estimates
9294 pos_smth = smoother .position ()
9395 vel_smth = smoother .velocity ()
9496 euler_smth = smoother .euler (degrees = True )
97+ err_smth = np .array ([P_i .diagonal () for P_i in smoother .P ])
9598
9699 # Half-sample shift
97100 # # (compensates for the delay introduced by Euler integration)
@@ -119,6 +122,9 @@ def test_benchmark_ains(self):
119122 euler_err_ains = np .std ((euler_ains - euler_ref )[warmup :], axis = 0 )
120123 np .testing .assert_array_less (euler_err_smth , euler_err_ains )
121124
125+ smoother .P .shape == (len (acc_imu ), 12 , 12 )
126+ np .testing .assert_array_less (err_smth [warmup :], err_ains [warmup :] + 1e-12 )
127+
122128 def test_benchmark_ahrs (self ):
123129 # Reference signal
124130 fs = 10.24 # sampling rate in Hz
0 commit comments