[Positioner] Option generate-single-packet-RPs
The new option positioning.generate-single-packet-reference-points allows either to generate one single packet in each generated reference point, or try to match the real requests by generating packets independently.
This commit is contained in:
parent
4c5ad300c3
commit
60626196d5
|
@ -103,6 +103,12 @@ csv-file = /tmp/owlps-positioner.log
|
||||||
# received.
|
# received.
|
||||||
#generate-reference-points = false
|
#generate-reference-points = false
|
||||||
|
|
||||||
|
# With this option enabled, each generated reference point will contain
|
||||||
|
# a single packet in a single calibration request. This is the default.
|
||||||
|
# If disabled, the generated reference points will contain a series of
|
||||||
|
# packets, better matching the real requests.
|
||||||
|
#generate-single-packet-reference-points = true
|
||||||
|
|
||||||
# When the above option is activated, the reference points are generated
|
# When the above option is activated, the reference points are generated
|
||||||
# with the specified distance (in meters) between one another, in the X
|
# with the specified distance (in meters) between one another, in the X
|
||||||
# and Y axis.
|
# and Y axis.
|
||||||
|
|
|
@ -589,36 +589,94 @@ void Stock::generate_reference_point(const Point3D &point)
|
||||||
float point_dst = rx_coord.distance(point) ;
|
float point_dst = rx_coord.distance(point) ;
|
||||||
// Constant term
|
// Constant term
|
||||||
double common_ss = rx->second.friis_constant_term() ;
|
double common_ss = rx->second.friis_constant_term() ;
|
||||||
// SS for REF1
|
|
||||||
const ReferencePoint &ref1_rp =
|
|
||||||
get_reference_point(ref1_coord) ;
|
|
||||||
double friis_index =
|
|
||||||
ref1_rp.friis_index_for_ap(rx->second.get_mac_addr()) ;
|
|
||||||
double ref1_ss =
|
|
||||||
common_ss +
|
|
||||||
ref1.get_trx_power() +
|
|
||||||
ref1.get_antenna_gain() -
|
|
||||||
10 * friis_index * log10(point_dst) ;
|
|
||||||
// SS for REF2
|
|
||||||
const ReferencePoint &ref2_rp =
|
|
||||||
get_reference_point(ref2_coord) ;
|
|
||||||
friis_index =
|
|
||||||
ref2_rp.friis_index_for_ap(rx->second.get_mac_addr()) ;
|
|
||||||
double ref2_ss =
|
|
||||||
common_ss +
|
|
||||||
ref2.get_trx_power() +
|
|
||||||
ref2.get_antenna_gain() -
|
|
||||||
10 * friis_index * log10(point_dst) ;
|
|
||||||
|
|
||||||
/* Compute the SS */
|
const string &rx_mac = rx->second.get_mac_addr() ;
|
||||||
ref1_ss = ref1_ss * ref1_percent / 100 ;
|
const ReferencePoint &ref1_rp = get_reference_point(ref1_coord) ;
|
||||||
ref2_ss = ref2_ss * ref2_percent / 100 ;
|
const ReferencePoint &ref2_rp = get_reference_point(ref2_coord) ;
|
||||||
double rx_ss = ref1_ss + ref2_ss ;
|
|
||||||
|
|
||||||
/* Create the measurement, add it to the list */
|
if (Configuration::
|
||||||
Measurement m(&rx->second) ;
|
bool_value("positioning.generate-single-packet-reference-points"))
|
||||||
m.add_ss(1, rx_ss) ;
|
{
|
||||||
measurements[rx->second.get_mac_addr()] = m ;
|
/* Friis indexes for REF1 & REF2 */
|
||||||
|
float ref1_friis_idx = ref1_rp.friis_index_for_ap(rx_mac) ;
|
||||||
|
float ref2_friis_idx = ref2_rp.friis_index_for_ap(rx_mac) ;
|
||||||
|
|
||||||
|
/* SS for REF1 & REF2 */
|
||||||
|
double ref1_ss =
|
||||||
|
common_ss +
|
||||||
|
ref1.get_trx_power() +
|
||||||
|
ref1.get_antenna_gain() -
|
||||||
|
10 * ref1_friis_idx * log10(point_dst) ;
|
||||||
|
double ref2_ss =
|
||||||
|
common_ss +
|
||||||
|
ref2.get_trx_power() +
|
||||||
|
ref2.get_antenna_gain() -
|
||||||
|
10 * ref2_friis_idx * log10(point_dst) ;
|
||||||
|
|
||||||
|
/* Compute the consolidated SS */
|
||||||
|
ref1_ss = ref1_ss * ref1_percent / 100 ;
|
||||||
|
ref2_ss = ref2_ss * ref2_percent / 100 ;
|
||||||
|
double rx_ss = ref1_ss + ref2_ss ;
|
||||||
|
|
||||||
|
/* Create the measurement, add it to the list */
|
||||||
|
Measurement m(&rx->second) ;
|
||||||
|
m.add_ss(1, rx_ss) ;
|
||||||
|
measurements[rx_mac] = m ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const vector<CalibrationRequest*> &ref1_cr =
|
||||||
|
ref1_rp.get_requests() ;
|
||||||
|
const Measurement *rx_measurement = NULL ;
|
||||||
|
vector<CalibrationRequest*>::const_iterator cr ;
|
||||||
|
|
||||||
|
// Search for the first measurement made by RX in ref1_rp
|
||||||
|
for (cr = ref1_cr.begin() ;
|
||||||
|
! rx_measurement && cr != ref1_cr.end() ; ++cr)
|
||||||
|
rx_measurement = (*cr)->get_measurement(rx_mac) ;
|
||||||
|
|
||||||
|
// The selected reference APs are in coverage of RX, therefore
|
||||||
|
// we should always find a measurement of RX in ref1_rp
|
||||||
|
assert(rx_measurement) ;
|
||||||
|
|
||||||
|
for (pkt_id_t pkt_id = 1 ; pkt_id < (*cr)->get_nb_packets() ;
|
||||||
|
++pkt_id)
|
||||||
|
{
|
||||||
|
/* Friis indexes for REF1 & REF2 */
|
||||||
|
float ref1_friis_idx =
|
||||||
|
ref1_rp.friis_index_for_ap(rx->second.get_mac_addr(),
|
||||||
|
pkt_id) ;
|
||||||
|
if (ref1_friis_idx == 0)
|
||||||
|
continue ; // The packet pkt_id does not exist in ref1_rp
|
||||||
|
float ref2_friis_idx =
|
||||||
|
ref2_rp.friis_index_for_ap(rx->second.get_mac_addr(),
|
||||||
|
pkt_id) ;
|
||||||
|
if (ref2_friis_idx == 0)
|
||||||
|
continue ; // The packet pkt_id does not exist in ref2_rp
|
||||||
|
|
||||||
|
/* SS for REF1 & REF2 */
|
||||||
|
double ref1_ss =
|
||||||
|
common_ss +
|
||||||
|
ref1.get_trx_power() +
|
||||||
|
ref1.get_antenna_gain() -
|
||||||
|
10 * ref1_friis_idx * log10(point_dst) ;
|
||||||
|
double ref2_ss =
|
||||||
|
common_ss +
|
||||||
|
ref2.get_trx_power() +
|
||||||
|
ref2.get_antenna_gain() -
|
||||||
|
10 * ref2_friis_idx * log10(point_dst) ;
|
||||||
|
|
||||||
|
/* Compute the consolidated SS */
|
||||||
|
ref1_ss = ref1_ss * ref1_percent / 100 ;
|
||||||
|
ref2_ss = ref2_ss * ref2_percent / 100 ;
|
||||||
|
double rx_ss = ref1_ss + ref2_ss ;
|
||||||
|
|
||||||
|
/* Create the measurement, add it to the list */
|
||||||
|
Measurement m(&rx->second) ;
|
||||||
|
m.add_ss(pkt_id, rx_ss) ;
|
||||||
|
measurements[rx_mac] = m ;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the virtual mobile */
|
/* Create the virtual mobile */
|
||||||
|
|
|
@ -242,6 +242,10 @@ void UserInterface::fill_positioning_options()
|
||||||
po::value<bool>()->default_value(false),
|
po::value<bool>()->default_value(false),
|
||||||
"Generate reference points from the (auto)calibration requests"
|
"Generate reference points from the (auto)calibration requests"
|
||||||
" received.")
|
" received.")
|
||||||
|
("positioning.generate-single-packet-reference-points",
|
||||||
|
po::value<bool>()->default_value(true),
|
||||||
|
"Generate only one packet per reference point, instead of trying to"
|
||||||
|
" match the packets in the real requests.")
|
||||||
("positioning.generated-meshing-grain-x",
|
("positioning.generated-meshing-grain-x",
|
||||||
po::value<float>()->default_value(DEFAULT_MESHING_GRAIN),
|
po::value<float>()->default_value(DEFAULT_MESHING_GRAIN),
|
||||||
"When generating reference points, this distance (in meters) will"
|
"When generating reference points, this distance (in meters) will"
|
||||||
|
|
Loading…
Reference in New Issue