[Positioner] New option filter.max-speed-cp
The new option positioning.filter.max-speed-cp allows to set an alternative maximum speed when the mobile is found to be within cp-reset-distance, instead of completely disabling the filter.
This commit is contained in:
parent
a1c8e0a093
commit
a56a8d3d5d
|
@ -257,16 +257,22 @@ mobile-csv-file = /usr/local/etc/owlps/mobiles.csv
|
||||||
# This option also controls the activation of the filter (0 = disabled).
|
# This option also controls the activation of the filter (0 = disabled).
|
||||||
#max-speed = 0
|
#max-speed = 0
|
||||||
|
|
||||||
# With this option set to a positive number, the filtering is temporary
|
# With this option set to a positive number, the maximum speed is
|
||||||
# disabled when the mobile terminal is found to be close enough to a
|
# temporarily set to max-speed-cp (instead of max-speed) when the mobile
|
||||||
# capture point. This option determines this "close enough" distance, in
|
# terminal is found to be close enough to a capture point. This option
|
||||||
# metres.
|
# determines this "close enough" distance, in metres.
|
||||||
# This is useful in deployments where the system is much more accurate
|
# This is useful in deployments where the system is much more accurate
|
||||||
# when the mobile is close to a capture point, such as underground
|
# when the mobile is close to a capture point, such as underground
|
||||||
# mining tunnels; in such environments, 15 m appears to be a reasonable
|
# mining tunnels; in such environments, 15 m appears to be a reasonable
|
||||||
# value to start experimenting.
|
# value to start experimenting.
|
||||||
#cp-reset-distance = 0
|
#cp-reset-distance = 0
|
||||||
|
|
||||||
|
# Maximal (virtual) speed at which the mobiles can move when they are
|
||||||
|
# within cp-reset-distance, in km/h. 0 (the default value) corresponds
|
||||||
|
# to an unlimited speed, i.e. filtering will be completely disabled when
|
||||||
|
# the mobile is found to be close to a CP.
|
||||||
|
#max-speed-cp = 0
|
||||||
|
|
||||||
[output]
|
[output]
|
||||||
# The following options are related to the output of the results.
|
# The following options are related to the output of the results.
|
||||||
|
|
||||||
|
|
|
@ -218,10 +218,11 @@ void Positioning::filter(const Request &request, Result &result)
|
||||||
cerr
|
cerr
|
||||||
<< "Filtering (algorithm " << algo_name << "): "
|
<< "Filtering (algorithm " << algo_name << "): "
|
||||||
<< "for request sent at " << timestamp
|
<< "for request sent at " << timestamp
|
||||||
<< " by mobile " << mobile->get_mac_addr() << ", " ;
|
<< " by mobile " << mobile->get_mac_addr()
|
||||||
|
<< " (maximum speed is " << max_speed << " km/h), " ;
|
||||||
|
|
||||||
/* Don't apply filter if the reset distance is configured and the
|
/* Use alternative maximum speed if the reset distance is configured
|
||||||
* mobile is within this distance */
|
* and the mobile is within this distance */
|
||||||
// Get the unfiltered coordinates:
|
// Get the unfiltered coordinates:
|
||||||
const Point3D &pos = result.get_position() ;
|
const Point3D &pos = result.get_position() ;
|
||||||
float reset_distance =
|
float reset_distance =
|
||||||
|
@ -236,8 +237,23 @@ void Positioning::filter(const Request &request, Result &result)
|
||||||
cerr
|
cerr
|
||||||
<< "the mobile appears to be within the reset distance"
|
<< "the mobile appears to be within the reset distance"
|
||||||
<< " of " << reset_distance
|
<< " of " << reset_distance
|
||||||
<< " m from a CP; no filtering.\n" ;
|
<< " m from a CP" ;
|
||||||
|
max_speed =
|
||||||
|
Configuration::float_value("positioning.filter.max-speed-cp") ;
|
||||||
|
if (max_speed <= 0)
|
||||||
|
{
|
||||||
|
if (Configuration::is_configured("verbose"))
|
||||||
|
cerr
|
||||||
|
<< " and the alternative speed is \"unlimited\";"
|
||||||
|
<< " no filtering.\n" ;
|
||||||
return ;
|
return ;
|
||||||
|
/* Note: saying that the mobile's speed is unlimited is
|
||||||
|
* another way to say that the filter is disabled. */
|
||||||
|
}
|
||||||
|
if (Configuration::is_configured("verbose"))
|
||||||
|
cerr
|
||||||
|
<< "; maximum speed set to alternative speed ("
|
||||||
|
<< max_speed << " km/h).\n" ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -334,8 +334,14 @@ void UserInterface::fill_positioning_options()
|
||||||
" speed).")
|
" speed).")
|
||||||
("positioning.filter.cp-reset-distance",
|
("positioning.filter.cp-reset-distance",
|
||||||
po::value<float>()->default_value(0),
|
po::value<float>()->default_value(0),
|
||||||
"Disable filtering when the computed position is at this distance (in"
|
"Use max-speed-cp instead of max-speed when the computed position is"
|
||||||
" m) from a CP or closer (0 = never disable filtering).")
|
" at this distance (in m) from a CP or closer (0 = never use"
|
||||||
|
" max-speed-cp).")
|
||||||
|
("positioning.filter.max-speed-cp",
|
||||||
|
po::value<float>()->default_value(0),
|
||||||
|
"Maximal (virtual) speed at which the mobiles can move when they are"
|
||||||
|
" within cp-reset-distance, in km/h (0 = unlimited speed, i.e."
|
||||||
|
" completely disables filtering when the mobile is close to a CP).")
|
||||||
;
|
;
|
||||||
|
|
||||||
file_options->add(options) ;
|
file_options->add(options) ;
|
||||||
|
|
Loading…
Reference in New Issue