some fixes [multithreading,..]
needed interface changes [new options] logger for android wifi-ap-optimization new test-cases
This commit is contained in:
@@ -86,8 +86,8 @@ public:
|
||||
KNN<KNNArray<std::vector<T>>, 3> knnStairs(knnArrStairs);
|
||||
|
||||
// probability adjustments
|
||||
Distribution::Normal<float> avoidWalls(0.0, 0.35);
|
||||
Distribution::Normal<float> favorDoors(0.0f, 0.5f);
|
||||
Distribution::Triangle<float> avoidWalls(0.0, 0.45f);
|
||||
Distribution::Normal<float> favorDoors(0.0f, 0.4f);
|
||||
Distribution::Normal<float> favorStairs(0.0f, 1.5f);
|
||||
|
||||
if (l) {
|
||||
@@ -120,20 +120,33 @@ public:
|
||||
// get the distance to the nearest stair
|
||||
const float distToStair_m = Units::cmToM(knnStairs.getNearestDistance( {n1.x_cm, n1.y_cm, n1.z_cm} ));
|
||||
|
||||
const bool useNormal = (distToWall_m < distToDoor_m && distToWall_m < distToStair_m);
|
||||
const bool useNormal = (distToWall_m*3.5 < distToDoor_m && distToWall_m*3.5 < distToStair_m);
|
||||
|
||||
// final probability
|
||||
n1.navImportance = 1.0f;
|
||||
n1.navImportance += favorDoors.getProbability(distToDoor_m) * 1.25f;
|
||||
n1.navImportance += favorStairs.getProbability(distToStair_m) * 30.5f;
|
||||
n1.walkImportance = 1.0f;
|
||||
//n1.walkImportance += favorDoors.getProbability(distToDoor_m) * 0.75f;
|
||||
n1.walkImportance += favorStairs.getProbability(distToStair_m) * 1.0f;
|
||||
|
||||
// use wall avoidance
|
||||
if (useNormal) {
|
||||
n1.navImportance -= avoidWalls.getProbability(distToWall_m) * 0.5f;
|
||||
n1.walkImportance -= avoidWalls.getProbability(distToWall_m) * 0.4f;
|
||||
}
|
||||
|
||||
|
||||
// navigation importance is calculated using other formulae
|
||||
n1.navImportance = 1.0f;
|
||||
if (useNormal) {
|
||||
n1.navImportance -= avoidWalls.getProbability(distToWall_m) * 0.4;
|
||||
}
|
||||
//n1.navImportance += favorDoors.getProbability(distToDoor_m) * 0.5;
|
||||
n1.navImportance += favorStairs.getProbability(distToStair_m) * 1.0;
|
||||
|
||||
|
||||
|
||||
|
||||
// sanity check
|
||||
Assert::isTrue(n1.navImportance >= 0, "detected negative importance. does not make sense!");
|
||||
Assert::isTrue(n1.walkImportance >= 0, "detected negative walk importance. does not make sense!");
|
||||
Assert::isTrue(n1.navImportance >= 0, "detected negative nav importance. does not make sense!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user