@@ -611,7 +611,7 @@ def batch_filter(self, zs, Rs=None, dts=None, UT=None, saver=None):
611
611
612
612
return (means , covariances )
613
613
614
- def rts_smoother (self , Xs , Ps , Qs = None , dts = None ):
614
+ def rts_smoother (self , Xs , Ps , Qs = None , dts = None , UT = None ):
615
615
"""
616
616
Runs the Rauch-Tung-Striebal Kalman smoother on a set of
617
617
means and covariances computed by the UKF. The usual input
@@ -637,6 +637,12 @@ def rts_smoother(self, Xs, Ps, Qs=None, dts=None):
637
637
an array, then each element k contains the time at step k.
638
638
Units are seconds.
639
639
640
+ UT : function(sigmas, Wm, Wc, noise_cov), optional
641
+ Optional function to compute the unscented transform for the sigma
642
+ points passed through hx. Typically the default function will
643
+ work - you can use x_mean_fn and z_mean_fn to alter the behavior
644
+ of the unscented transform.
645
+
640
646
Returns
641
647
-------
642
648
@@ -674,6 +680,9 @@ def rts_smoother(self, Xs, Ps, Qs=None, dts=None):
674
680
if Qs is None :
675
681
Qs = [self .Q ] * n
676
682
683
+ if UT is None :
684
+ UT = unscented_transform
685
+
677
686
# smoother gain
678
687
Ks = zeros ((n , dim_x , dim_x ))
679
688
@@ -688,7 +697,7 @@ def rts_smoother(self, Xs, Ps, Qs=None, dts=None):
688
697
for i in range (num_sigmas ):
689
698
sigmas_f [i ] = self .fx (sigmas [i ], dts [k ])
690
699
691
- xb , Pb = unscented_transform (
700
+ xb , Pb = UT (
692
701
sigmas_f , self .Wm , self .Wc , self .Q ,
693
702
self .x_mean , self .residual_x )
694
703
0 commit comments