[Positioning] Fix FBCM with autocalibration
Regenerate Friis indexes at each call of the algorithm when autocalibration is used (without this fix, FBCM given always the same result autocalibration activated, because of the Friis indexes equal to zero).
This commit is contained in:
parent
6167f664e8
commit
2c887899b3
1
TODO
1
TODO
|
@ -69,7 +69,6 @@
|
||||||
* Positioning
|
* Positioning
|
||||||
|
|
||||||
- Known bugs
|
- Known bugs
|
||||||
° FBCM always gives the same result.
|
|
||||||
° Cannot compute the error (Real) with autocalibration requests.
|
° Cannot compute the error (Real) with autocalibration requests.
|
||||||
|
|
||||||
- Algorithms
|
- Algorithms
|
||||||
|
|
|
@ -298,7 +298,9 @@ $(OBJ_DIR)/minmax.o: \
|
||||||
$(OBJ_DIR)/interlinknetworks.o: \
|
$(OBJ_DIR)/interlinknetworks.o: \
|
||||||
$(OBJ_DIR)/multilaterationalgorithm.o
|
$(OBJ_DIR)/multilaterationalgorithm.o
|
||||||
$(OBJ_DIR)/fbcm.o: \
|
$(OBJ_DIR)/fbcm.o: \
|
||||||
$(OBJ_DIR)/multilaterationalgorithm.o
|
$(OBJ_DIR)/multilaterationalgorithm.o \
|
||||||
|
$(OBJ_DIR)/configuration.o \
|
||||||
|
$(OBJ_DIR)/stock.o
|
||||||
$(OBJ_DIR)/frbhmbasic.o: \
|
$(OBJ_DIR)/frbhmbasic.o: \
|
||||||
$(OBJ_DIR)/radar.o \
|
$(OBJ_DIR)/radar.o \
|
||||||
$(OBJ_DIR)/fbcm.o
|
$(OBJ_DIR)/fbcm.o
|
||||||
|
|
|
@ -1,7 +1,19 @@
|
||||||
#include "fbcm.hh"
|
#include "fbcm.hh"
|
||||||
|
#include "stock.hh"
|
||||||
|
#include "configuration.hh"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Result FBCM::compute(const Request &_request)
|
||||||
|
{
|
||||||
|
// If the autocalibration is activated, we have to regenerate the
|
||||||
|
// Friis indexes each time we calculate a position
|
||||||
|
if (Configuration::bool_value("positioning.generate-reference-points"))
|
||||||
|
Stock::update_all_friis_indexes() ;
|
||||||
|
return MultilaterationAlgorithm::compute(_request) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
float FBCM::estimate_distance(const Measurement &measurement)
|
float FBCM::estimate_distance(const Measurement &measurement)
|
||||||
{
|
{
|
||||||
double constant_term = make_constant_term(measurement) ;
|
double constant_term = make_constant_term(measurement) ;
|
||||||
|
|
|
@ -13,7 +13,11 @@ public:
|
||||||
FBCM(void): PositioningAlgorithm("FBCM") {}
|
FBCM(void): PositioningAlgorithm("FBCM") {}
|
||||||
~FBCM(void) {}
|
~FBCM(void) {}
|
||||||
|
|
||||||
|
/** @name Operations */
|
||||||
|
//@{
|
||||||
|
Result compute(const Request &_request) ;
|
||||||
float estimate_distance(const Measurement &measurement) ;
|
float estimate_distance(const Measurement &measurement) ;
|
||||||
|
//@}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
#endif // _OWLPS_POSITIONING_FBCM_HH_
|
#endif // _OWLPS_POSITIONING_FBCM_HH_
|
||||||
|
|
|
@ -61,7 +61,12 @@ void Positioning::initialise_algorithms()
|
||||||
|
|
||||||
else if (*i == "FBCM")
|
else if (*i == "FBCM")
|
||||||
{
|
{
|
||||||
Stock::update_all_friis_indexes() ;
|
// Generate the Friis indexes only if the autocalibration is
|
||||||
|
// not activated (if it is, Friis indexes will be regenerated
|
||||||
|
// each time FBCM wants to computes a position)
|
||||||
|
if (! Configuration::
|
||||||
|
bool_value("positioning.generate-reference-points"))
|
||||||
|
Stock::update_all_friis_indexes() ;
|
||||||
algorithms.push_back(new FBCM) ;
|
algorithms.push_back(new FBCM) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue