huge commit
- worked on about everything - grid walker using plugable modules - wifi models - new distributions - worked on geometric data-structures - added typesafe timestamps - worked on grid-building - added sensor-classes - added sensor analysis (step-detection, turn-detection) - offline data reader - many test-cases
This commit is contained in:
39
tests/sensors/radio/TestLogDistanceCeilingModel.cpp
Normal file
39
tests/sensors/radio/TestLogDistanceCeilingModel.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
#include "../../Tests.h"
|
||||
|
||||
#include "../../../sensors/radio/model/WiFiModelLogDistCeiling.h"
|
||||
|
||||
TEST(LogDistanceCeilingModel, calc) {
|
||||
|
||||
Floorplan::Floor* f0 = new Floorplan::Floor(); f0->atHeight = 0;
|
||||
Floorplan::Floor* f1 = new Floorplan::Floor(); f1->atHeight = 3;
|
||||
Floorplan::Floor* f2 = new Floorplan::Floor(); f2->atHeight = 7;
|
||||
|
||||
Floorplan::IndoorMap map;
|
||||
map.floors.push_back(f0);
|
||||
map.floors.push_back(f1);
|
||||
map.floors.push_back(f2);
|
||||
|
||||
LocatedAccessPoint ap0("00:00:00:00:00:00", Point3(0,0,0));
|
||||
LocatedAccessPoint ap25("00:00:00:00:00:00", Point3(0,0,2.5));
|
||||
|
||||
WiFiModelLogDistCeiling model(-40, 1.0, -8.0, &map);
|
||||
|
||||
|
||||
ASSERT_EQ(-40, model.getRSSI(ap0, Point3(1,0,0)));
|
||||
ASSERT_EQ(-40, model.getRSSI(ap0, Point3(0,1,0)));
|
||||
ASSERT_EQ(-40, model.getRSSI(ap0, Point3(0,0,1)));
|
||||
|
||||
ASSERT_EQ(-40, model.getRSSI(ap25, Point3(1,0,2.5)));
|
||||
ASSERT_EQ(-40, model.getRSSI(ap25, Point3(0,1,2.5)));
|
||||
ASSERT_EQ(-40-8, model.getRSSI(ap25, Point3(0,0,3.5))); // one floor within
|
||||
|
||||
ASSERT_EQ(model.getRSSI(ap0, Point3(8,0,0)), model.getRSSI(ap0, Point3(0,8,0)));
|
||||
ASSERT_EQ(model.getRSSI(ap0, Point3(8,0,0)), model.getRSSI(ap0, Point3(0,0,8))+8+8); // two ceilings within
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user