1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
From 71457ab69083af8c11730d41644659b0d32106a1 Mon Sep 17 00:00:00 2001
From: Klaas Gadeyne <klaas.gadeyne@gmail.com>
Date: Fri, 25 May 2018 08:49:05 +0200
Subject: [PATCH] fix test that sometimes caused havoc in Mac OS X due to
different approximation/rounding.
---
tests/complete_filter_test.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tests/complete_filter_test.cpp b/tests/complete_filter_test.cpp
index f909664..6826051 100644
--- a/tests/complete_filter_test.cpp
+++ b/tests/complete_filter_test.cpp
@@ -451,11 +451,16 @@ Complete_FilterTest::testComplete_FilterValue_Discr()
filter.Update(&sys_model,&meas_model,measurement);
} // estimation loop
+ // FIXME: This test needs more explanation...
DiscretePdf * posterior = filter.PostGet();
for (int state=0; state< num_states; state++)
{
- //cout << state << ": " << posterior->ProbabilityGet(state) << endl;
- if (state== (int)(mobile_robot.GetState()(2)) ) CPPUNIT_ASSERT(posterior->ProbabilityGet(state) >0.9);
- else CPPUNIT_ASSERT(posterior->ProbabilityGet(state) <0.1);
+ // std::cout << "state = " << state << " : " << "posterior->ProbabilityGet(state) = " << posterior->ProbabilityGet(state) << std::endl;
+ if (state == (int)(round(mobile_robot.GetState()(2))) ){ // Y position What does this comparison mean???
+ CPPUNIT_ASSERT(posterior->ProbabilityGet(state) >0.9);
+ }
+ else {
+ CPPUNIT_ASSERT(posterior->ProbabilityGet(state) <0.1);
+ }
}
}
|