[Positioning] Opt. radar-ignore-ap-reference-points
Add the option positioning.radar-ignore-ap-reference-points, to be able to select only generated reference points.
This commit is contained in:
parent
089c8e3f8f
commit
0da98cdb05
|
@ -63,6 +63,13 @@ csv-file = /tmp/owlps-positioning.log
|
|||
# request is compared directly to each calibration request.
|
||||
#radar-average-reference-points = false
|
||||
|
||||
# With the RADAR algorithm, do not select reference points on which an
|
||||
# AP is sit, as far as possible (i.e. if there are reference points
|
||||
# where no AP sits). This is useful if you are using autocalibration
|
||||
# and want to select only the generated reference points.
|
||||
# The default is false.
|
||||
#radar-ignore-ap-reference-points = false
|
||||
|
||||
# Generate reference points from the (auto)calibration requests
|
||||
# received.
|
||||
#generate-reference-points = false
|
||||
|
|
|
@ -387,13 +387,31 @@ closest_reference_point(const Request &request)
|
|||
"Cannot search for the closest reference point: reference points'"
|
||||
" list is empty!") ;
|
||||
|
||||
bool ignore_aps = Configuration::bool_value(
|
||||
"positioning.radar-ignore-ap-reference-points") ;
|
||||
unordered_set<ReferencePoint>::const_iterator i =
|
||||
reference_points.begin() ;
|
||||
|
||||
if (ignore_aps)
|
||||
{
|
||||
// Fast-forward to the next non-AP reference point
|
||||
while (i != reference_points.end() && is_ap_coordinate(*i))
|
||||
++i ;
|
||||
|
||||
// No non-AP reference point was found, we are forced to consider
|
||||
// the AP reference points
|
||||
if (i == reference_points.end())
|
||||
ignore_aps = false ;
|
||||
}
|
||||
|
||||
float distance = i->ss_square_distance(request) ;
|
||||
unordered_set<ReferencePoint>::const_iterator closest = i ;
|
||||
|
||||
for (++i ; i != reference_points.end() ; ++i)
|
||||
{
|
||||
if (ignore_aps && is_ap_coordinate(*i))
|
||||
continue ;
|
||||
|
||||
float tmp_distance = i->ss_square_distance(request) ;
|
||||
if (tmp_distance < distance)
|
||||
{
|
||||
|
@ -673,13 +691,32 @@ closest_calibration_request(const Request &request)
|
|||
"Cannot search for the closest calibration request: calibration"
|
||||
" requests' list is empty!") ;
|
||||
|
||||
bool ignore_aps = Configuration::bool_value(
|
||||
"positioning.radar-ignore-ap-reference-points") ;
|
||||
unordered_set<CalibrationRequest>::const_iterator i =
|
||||
calibration_requests.begin() ;
|
||||
|
||||
if (ignore_aps)
|
||||
{
|
||||
// Fast-forward to the next non-AP reference point
|
||||
while (i != calibration_requests.end() &&
|
||||
is_ap_coordinate(*i->get_reference_point()))
|
||||
++i ;
|
||||
|
||||
// No non-AP reference point was found, we are forced to consider
|
||||
// the AP reference points
|
||||
if (i == calibration_requests.end())
|
||||
ignore_aps = false ;
|
||||
}
|
||||
|
||||
float distance = i->ss_square_distance(request) ;
|
||||
unordered_set<CalibrationRequest>::const_iterator closest = i ;
|
||||
|
||||
for (++i ; i != calibration_requests.end() ; ++i)
|
||||
{
|
||||
if (ignore_aps && is_ap_coordinate(*i->get_reference_point()))
|
||||
continue ;
|
||||
|
||||
float tmp_distance = i->ss_square_distance(request) ;
|
||||
if (tmp_distance < distance)
|
||||
{
|
||||
|
|
|
@ -204,6 +204,10 @@ void UserInterface::fill_positioning_options()
|
|||
po::value<float>()->default_value(0.5),
|
||||
"When generating reference points, this distance (in meters) will"
|
||||
" separate each point to the next.")
|
||||
("positioning.radar-ignore-ap-reference-points",
|
||||
po::value<bool>()->default_value(false),
|
||||
"With the RADAR algorithm, try to avoid selecting the reference"
|
||||
" points which are coordinates of an AP.")
|
||||
("positioning.accept-new-calibration-requests",
|
||||
po::value<bool>()->default_value(false),
|
||||
"Add the calibration requests received during the run-time to"
|
||||
|
|
Loading…
Reference in New Issue