@@ -16,28 +16,26 @@ using namespace Eigen;
16
16
UKFCorrection::UKFCorrection
17
17
(
18
18
std::unique_ptr<MeasurementModel> measurement_model,
19
- const size_t n,
20
19
const double alpha,
21
20
const double beta,
22
21
const double kappa
23
22
) noexcept :
24
23
measurement_model_ (std::move(measurement_model)),
25
24
type_(UKFCorrectionType::Generic),
26
- ut_weight_(n , alpha, beta, kappa)
25
+ ut_weight_(measurement_model_-> getInputDescription () , alpha, beta, kappa)
27
26
{ }
28
27
29
28
30
29
UKFCorrection::UKFCorrection
31
30
(
32
31
std::unique_ptr<AdditiveMeasurementModel> measurement_model,
33
- const size_t n,
34
32
const double alpha,
35
33
const double beta,
36
34
const double kappa
37
35
) noexcept :
38
36
additive_measurement_model_(std::move(measurement_model)),
39
37
type_(UKFCorrectionType::Additive),
40
- ut_weight_(n , alpha, beta, kappa)
38
+ ut_weight_(additive_measurement_model_-> getInputDescription ().noiseless_description() , alpha, beta, kappa)
41
39
{ }
42
40
43
41
@@ -89,11 +87,8 @@ void UKFCorrection::correctStep(const GaussianMixture& pred_state, GaussianMixtu
89
87
return ;
90
88
}
91
89
92
- /* Initialize predicted measurement GaussianMixture. */
93
- std::pair<std::size_t , std::size_t > meas_sizes = model.getOutputSize ();
94
- std::size_t meas_size = meas_sizes.first + meas_sizes.second ;
95
- /* GaussianMixture will effectively resize only if it needs to. */
96
- predicted_meas_.resize (pred_state.components , meas_size);
90
+ /* Extract measurement size. */
91
+ std::size_t meas_size = model.getMeasurementDescription ().total_size ();
97
92
98
93
/* Evaluate the joint state-measurement statistics, if possible. */
99
94
bool valid = false ;
0 commit comments