From 21c7f803453efb9731c62e540ffc2e1b8d6acce3 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Sat, 30 Jul 2011 14:21:37 +0200 Subject: [PATCH] [Positioning] Rename options minmax-* area-* The options minmax-start and minmax-stop are also used by the autocalibration process to know in which area reference points must be generated. Therefore these options are renamed area-start and area-stop. --- owlps-positioning/TODO | 2 -- owlps-positioning/cfg/owlps-positioning.conf | 9 ++++++--- owlps-positioning/cfg/topology.csv | 13 +++++++++---- owlps-positioning/src/multilaterationalgorithm.cc | 12 ++++++------ owlps-positioning/src/stock.cc | 8 ++++---- owlps-positioning/src/userinterface.cc | 15 +++++++++------ 6 files changed, 34 insertions(+), 25 deletions(-) diff --git a/owlps-positioning/TODO b/owlps-positioning/TODO index 3bf131e..04cad7f 100644 --- a/owlps-positioning/TODO +++ b/owlps-positioning/TODO @@ -40,8 +40,6 @@ ° Add the area to the result in OutputCSV. ° When reading the APs, add them to the mobiles' list (or another way to be able to have a single entry for an AP). - ° Rename minmax-start & stop, since it is used elsewhere (grep - minmax-start). ° Review the option names & descriptions. ° Add option positioning.self-calibrate (or autocalibrate), to activate automatically the options needed by the autocalibration. diff --git a/owlps-positioning/cfg/owlps-positioning.conf b/owlps-positioning/cfg/owlps-positioning.conf index f5c98b9..cf93d39 100644 --- a/owlps-positioning/cfg/owlps-positioning.conf +++ b/owlps-positioning/cfg/owlps-positioning.conf @@ -49,13 +49,16 @@ csv-file = /tmp/owlps-positioning.log #algorithm = RADAR #algorithm = FRBHMBasic -# Start and stop coordinates for the MinMax multilateration method. +# Coordinates of the deployment area. +# This is used to delimit the area in which reference points are +# generated (when generate-reference-points is activated), and also +# by the MinMax multilateration method. # Since MinMax is currently the only multilateration method implemented # in OwlPS, you should define these parameters if you use any of the # multilateration-based algorithms (InterlinkNetworks, FBCM, FRBHM). # They are declared as strings (X;Y;Z). Do not quote! -#minmax-start = -2;-2;0 -#minmax-stop = 20;30;6 +#area-start = -2;-2;0 +#area-stop = 20;30;6 # With the RADAR algorithm, for a given positioning request, average # all the calibration requests associated with a reference point before diff --git a/owlps-positioning/cfg/topology.csv b/owlps-positioning/cfg/topology.csv index 9eac23f..8abee10 100644 --- a/owlps-positioning/cfg/topology.csv +++ b/owlps-positioning/cfg/topology.csv @@ -5,12 +5,17 @@ # handle it. Since none of them are currently implemented, you # probably can save a lot of time by skipping the topology (and # waypoints) description. +# However, you can describe areas if you want to know when the mobile +# is in a particular location. In that case be sure that the algorithm +# you use will be able to generate positions that match each described +# area (in particular, with RADAR, at least one reference point should +# be present in each area). # # ALSO IMPORTANT (EVEN IF YOU DON'T DESCRIBE THE TOPOLOGY): -# If you use the MinMax multilateration method, you should provide -# minmax-start and minmax-stop parameters that match the deployment -# area. That is, the cuboid formed by these two points should include -# the whole deployment area. +# If you use the MinMax multilateration method, or the autocalibration, +# you must provide area-start and area-stop options that match the +# deployment area. That is, the cuboid formed by these two points +# should include the whole deployment area. # # This file lists the buildings and their "homogeneous areas" (rooms). # diff --git a/owlps-positioning/src/multilaterationalgorithm.cc b/owlps-positioning/src/multilaterationalgorithm.cc index f3f8b57..84d5147 100644 --- a/owlps-positioning/src/multilaterationalgorithm.cc +++ b/owlps-positioning/src/multilaterationalgorithm.cc @@ -18,16 +18,16 @@ MultilaterationAlgorithm::MultilaterationAlgorithm(): // Will be changed when other multilateration methods will be // implemented. - if (! Configuration::is_configured("positioning.minmax-start") || - ! Configuration::is_configured("positioning.minmax-stop")) + if (! Configuration::is_configured("positioning.area-start") || + ! Configuration::is_configured("positioning.area-stop")) throw missing_configuration( - "You want to use MinMax, but either positioning.minmax-start or" - " positioning.minmax-stop is not defined!") ; + "You want to use MinMax, but either positioning.area-start or" + " positioning.area-stop is not defined!") ; Point3D minmax_start( - Configuration::string_value("positioning.minmax-start")) ; + Configuration::string_value("positioning.area-start")) ; Point3D minmax_stop( - Configuration::string_value("positioning.minmax-stop")) ; + Configuration::string_value("positioning.area-stop")) ; multilateration_method = new MinMax(minmax_start, minmax_stop) ; } diff --git a/owlps-positioning/src/stock.cc b/owlps-positioning/src/stock.cc index d020a63..b86ff10 100644 --- a/owlps-positioning/src/stock.cc +++ b/owlps-positioning/src/stock.cc @@ -477,15 +477,15 @@ void Stock::regenerate_reference_points() } /* Generate RPs */ - if (! Configuration::is_configured("positioning.minmax-start") || - ! Configuration::is_configured("positioning.minmax-stop")) + if (! Configuration::is_configured("positioning.area-start") || + ! Configuration::is_configured("positioning.area-stop")) throw missing_configuration( "You must define the deployment area in order to generate" " reference points.") ; Point3D start( - Configuration::string_value("positioning.minmax-start")) ; + Configuration::string_value("positioning.area-start")) ; Point3D stop( - Configuration::string_value("positioning.minmax-stop")) ; + Configuration::string_value("positioning.area-stop")) ; float step_x = Configuration::float_value("positioning.generated-meshing-grain-x") ; float step_y = diff --git a/owlps-positioning/src/userinterface.cc b/owlps-positioning/src/userinterface.cc index b38e3bf..867dbcc 100644 --- a/owlps-positioning/src/userinterface.cc +++ b/owlps-positioning/src/userinterface.cc @@ -183,12 +183,15 @@ void UserInterface::fill_positioning_options() "Algorithms used to compute positions. You can specify" "this option more than once (but at least once). Allowed: Real, FBCM," " FRBHMBasic, InterlinkNetworks, RADAR.") - ("positioning.minmax-start", po::value(), - "Coordinates of the start point of the MinMax multilateration" - " method (string format: \"X;Y;Z\").") - ("positioning.minmax-stop", po::value(), - "Coordinates of the stop point of the MinMax multilateration" - " method (string format: \"X;Y;Z\").") + ("positioning.area-start", po::value(), + "Coordinates of the first point of the deployment area; this is" + " used to delimit the area in which the MinMax multilateration" + " method tests points and in which the reference points are" + " generated, if the corresponding options are activated" + " (string format: \"X;Y;Z\").") + ("positioning.area-stop", po::value(), + "Coordinates of the last point of the deployment area" + " (string format: \"X;Y;Z\").") ("positioning.radar-average-reference-points", po::value()->default_value(false), "With the RADAR algorithm, for a given positioning request, average"