Skip to content

Commit

Permalink
Core: boards distance in cm + tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomicera committed Nov 19, 2019
1 parent c78e009 commit 5a7478f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/server/src/statistics.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "statistics.h"
#include "settings.h"
#include <iostream>

Point statistics::getPosition(std::string hash, std::unordered_map< std::string, followifier::ESP32Metadata> &messageBoardsAndMetadata) {
std::unordered_set<Point, Point::PointHasher> listPossiblePoints;
Expand Down Expand Up @@ -49,7 +50,10 @@ Point statistics::getPosition(std::string hash, std::unordered_map< std::string,
}

double statistics::estimatedDistance(double rssi){
return std::pow(10, (ONE_METER_RSSI - rssi)/10*2);
double distance = std::pow(10, (ONE_METER_RSSI - rssi)/(10*2));
distance *= 1.1; // FIXME Make tolerance a variable
std::cout << "Estimated distance: " << distance << std::endl; // TODO glog
return distance * 100;
}

bool statistics::checkPoint(double x, double y,
Expand Down

0 comments on commit 5a7478f

Please sign in to comment.