Skip to content

Commit 00a3971

Browse files
committed
Update tests
1 parent 192278f commit 00a3971

File tree

7 files changed

+23
-17
lines changed

7 files changed

+23
-17
lines changed

test/test_Gaussian_Density_UVR/main.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,15 @@ class SimulatedMeasurement : public AdditiveMeasurementModel
6969
}
7070

7171

72-
std::pair<std::size_t, std::size_t> getOutputSize() const override
72+
VectorDescription getInputDescription() const override
7373
{
74-
return std::pair<std::size_t, std::size_t>(measurement_.size(), 0);
74+
return VectorDescription(3, 0, measurement_.size());
75+
}
76+
77+
78+
VectorDescription getMeasurementDescription() const override
79+
{
80+
return VectorDescription(measurement_.size());
7581
}
7682

7783
private:
@@ -87,12 +93,6 @@ int main()
8793
{
8894
std::cout << "Constructing a simulated scenario..." << std::endl;
8995

90-
// Unscented Transform parameters
91-
double alpha = 1.0;
92-
double beta = 2.0;
93-
double kappa = 0.0;
94-
sigma_point::UTWeight ut_weight(3, alpha, beta, kappa);
95-
9696
// Predicted state
9797
Gaussian predicted_state(3);
9898
Matrix3d covariance;
@@ -121,6 +121,12 @@ int main()
121121

122122
SimulatedMeasurement measurement_model(measurement, predicted);
123123

124+
// Unscented Transform parameters
125+
double alpha = 1.0;
126+
double beta = 2.0;
127+
double kappa = 0.0;
128+
sigma_point::UTWeight ut_weight(measurement_model.getInputDescription().noiseless_description(), alpha, beta, kappa);
129+
124130
// Propagate belief
125131
GaussianMixture predicted_measurement(1, 6);
126132
MatrixXd cross_covariance;

test/test_UKF/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int main(int argc, char* argv[])
131131
/* Step 2.2 - Define the prediction step. */
132132

133133
/* Initialize the unscented Kalman filter prediction step and pass the ownership of the state model */
134-
std::unique_ptr<UKFPrediction> ukf_prediction = utils::make_unique<UKFPrediction>(std::move(wna), state_size, alpha, beta, kappa);
134+
std::unique_ptr<UKFPrediction> ukf_prediction = utils::make_unique<UKFPrediction>(std::move(wna), alpha, beta, kappa);
135135

136136

137137
/* Step 3 - Correction */
@@ -158,7 +158,7 @@ int main(int argc, char* argv[])
158158
simulated_linear_sensor->enable_log("./", "testUKF");
159159

160160
/* Step 3.3 - Initialize the unscented Kalman filter correction step and pass the ownership of the measurement model. */
161-
std::unique_ptr<UKFCorrection> ukf_correction = utils::make_unique<UKFCorrection>(std::move(simulated_linear_sensor), state_size, alpha, beta, kappa);
161+
std::unique_ptr<UKFCorrection> ukf_correction = utils::make_unique<UKFCorrection>(std::move(simulated_linear_sensor), alpha, beta, kappa);
162162

163163

164164
/* Step 4 - Assemble the unscented Kalman filter. */

test/test_UPF/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int main(int argc, char* argv[])
159159

160160
/* Initialize the kalman particle filter prediction step that wraps a Gaussian prediction step,
161161
in this case an unscented kalman filter prediction step. */
162-
std::unique_ptr<GaussianPrediction> upf_prediction = utils::make_unique<UKFPrediction>(std::move(wna), state_size, alpha, beta, kappa);
162+
std::unique_ptr<GaussianPrediction> upf_prediction = utils::make_unique<UKFPrediction>(std::move(wna), alpha, beta, kappa);
163163
std::unique_ptr<PFPrediction> gpf_prediction = utils::make_unique<GPFPrediction>(std::move(upf_prediction));
164164

165165

@@ -200,7 +200,7 @@ int main(int argc, char* argv[])
200200

201201
/* Initialize the particle filter correction step that wraps a Guassian correction step,
202202
in this case an unscented kalman filter correction step. */
203-
std::unique_ptr<GaussianCorrection> upf_correction = utils::make_unique<UKFCorrection>(std::move(simulated_linear_sensor), state_size, alpha, beta, kappa);
203+
std::unique_ptr<GaussianCorrection> upf_correction = utils::make_unique<UKFCorrection>(std::move(simulated_linear_sensor), alpha, beta, kappa);
204204
std::unique_ptr<PFCorrection> gpf_correction = utils::make_unique<GPFCorrection>(std::move(exp_likelihood), std::move(upf_correction), std::move(transition_probability_model));
205205

206206

test/test_UPF_MAP/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ int main(int argc, char* argv[])
191191

192192
/* Initialize the kalman particle filter prediction step that wraps a Gaussian prediction step,
193193
in this case an unscented kalman filter prediction step. */
194-
std::unique_ptr<GaussianPrediction> upf_prediction = utils::make_unique<UKFPrediction>(std::move(wna), state_size, alpha, beta, kappa);
194+
std::unique_ptr<GaussianPrediction> upf_prediction = utils::make_unique<UKFPrediction>(std::move(wna), alpha, beta, kappa);
195195
std::unique_ptr<PFPrediction> gpf_prediction = utils::make_unique<GPFPrediction>(std::move(upf_prediction));
196196

197197

@@ -232,7 +232,7 @@ int main(int argc, char* argv[])
232232

233233
/* Initialize the particle filter correction step that wraps a Guassian correction step,
234234
in this case an unscented kalman filter correction step. */
235-
std::unique_ptr<GaussianCorrection> upf_correction = utils::make_unique<UKFCorrection>(std::move(simulated_linear_sensor), state_size, alpha, beta, kappa);
235+
std::unique_ptr<GaussianCorrection> upf_correction = utils::make_unique<UKFCorrection>(std::move(simulated_linear_sensor), alpha, beta, kappa);
236236
std::unique_ptr<PFCorrection> gpf_correction = utils::make_unique<GPFCorrection>(std::move(exp_likelihood), std::move(upf_correction), std::move(transition_probability_model));
237237

238238

test/test_mixed_KF_SUKF/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ int main(int argc, char* argv[])
156156
simulated_linear_sensor->enable_log("./", "testKF_SUKF");
157157

158158
/* Step 3.3 - Initialize the serial unscented Kalman filter correction step and pass the ownership of the measurement model. */
159-
std::unique_ptr<GaussianCorrection> sukf_correction = utils::make_unique<SUKFCorrection>(std::move(simulated_linear_sensor), state_size, alpha, beta, kappa, 2, true);
159+
std::unique_ptr<GaussianCorrection> sukf_correction = utils::make_unique<SUKFCorrection>(std::move(simulated_linear_sensor), alpha, beta, kappa, 2, true);
160160

161161

162162
/* Step 4 - Assemble the serial unscented Kalman filter */

test/test_mixed_KF_UKF/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ int main(int argc, char* argv[])
157157
simulated_linear_sensor->enable_log("./", "testKF_UKF");
158158

159159
/* Step 3.3 - Initialize the unscented Kalman filter correction step and pass the ownership of the measurement model. */
160-
std::unique_ptr<UKFCorrection> ukf_correction = utils::make_unique<UKFCorrection>(std::move(simulated_linear_sensor), state_size, alpha, beta, kappa);
160+
std::unique_ptr<UKFCorrection> ukf_correction = utils::make_unique<UKFCorrection>(std::move(simulated_linear_sensor), alpha, beta, kappa);
161161

162162

163163
/* Step 4 - Assemble the mixed Kalman filter. */

test/test_mixed_UKF_KF/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ int main(int argc, char* argv[])
132132
/* Step 2.2 - Define the prediction step. */
133133

134134
/* Initialize the unscented Kalman filter prediction step and pass the ownership of the state model. */
135-
std::unique_ptr<UKFPrediction> ukf_prediction = utils::make_unique<UKFPrediction>(std::move(wna), state_size, alpha, beta, kappa);
135+
std::unique_ptr<UKFPrediction> ukf_prediction = utils::make_unique<UKFPrediction>(std::move(wna), alpha, beta, kappa);
136136

137137

138138
/* Step 3 - Correction */

0 commit comments

Comments
 (0)