fixed some potential issues with MAC addresses
added corresponding test-cases switched to newer version of tinyxml due to some issues adjusted affected code-parts accordingly for better re-use, moved ceiling-calculation to a new class some minor fixes new helper methods worked on wifi-opt
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
#include "../../Tests.h"
|
||||
#include "../../../sensors/radio/setup/WiFiOptimizer.h"
|
||||
#include "../../../sensors/radio/setup/WiFiOptimizerLogDistCeiling.h"
|
||||
#include "../../../sensors/radio/setup/WiFiFingerprint.h"
|
||||
#include "../../../misc/Debug.h"
|
||||
|
||||
@@ -55,23 +55,23 @@ TEST(WiFiOptimizer, optimize) {
|
||||
|
||||
}
|
||||
|
||||
WiFiOptimizer opt(&map, vg);
|
||||
WiFiOptimizer::LogDistCeiling opt(&map, vg);
|
||||
for (const WiFiFingerprint& fp : fingerprints) {
|
||||
opt.addFingerprint(fp);
|
||||
}
|
||||
|
||||
ASSERT_EQ(2, opt.getAllMACs().size());
|
||||
float errRes;
|
||||
WiFiOptimizer::LogDistCeiling::Stats errRes;
|
||||
|
||||
const WiFiOptimizer::APParams params1 = opt.optimize(mac1, errRes);
|
||||
ASSERT_TRUE(errRes < 0.1);
|
||||
const WiFiOptimizer::LogDistCeiling::APParams params1 = opt.optimize(mac1, errRes);
|
||||
ASSERT_TRUE(errRes.error_db < 0.1);
|
||||
ASSERT_NEAR(0, pos1.getDistance(params1.getPos()), 0.4); // apx position estimation
|
||||
ASSERT_NEAR(-40, params1.txp, 1.0);
|
||||
ASSERT_NEAR(2, params1.exp, 0.1);
|
||||
ASSERT_NEAR(-4, params1.waf, 0.5);
|
||||
|
||||
const WiFiOptimizer::APParams params2 = opt.optimize(mac2, errRes);
|
||||
ASSERT_TRUE(errRes < 0.1);
|
||||
const WiFiOptimizer::LogDistCeiling::APParams params2 = opt.optimize(mac2, errRes);
|
||||
ASSERT_TRUE(errRes.error_db < 0.1);
|
||||
ASSERT_NEAR(0, pos2.getDistance(params2.getPos()), 0.4); // apx position estimation
|
||||
ASSERT_NEAR(-40, params1.txp, 1.0);
|
||||
ASSERT_NEAR(2, params2.exp, 0.1);
|
||||
|
||||
Reference in New Issue
Block a user