48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/*
|
|
* This file is part of the Owl Positioning System (OwlPS).
|
|
* OwlPS is a project of the University of Franche-Comté
|
|
* (Université de Franche-Comté), France.
|
|
*/
|
|
|
|
|
|
#ifndef _OWLPS_POSITIONING_MINMAX_HH_
|
|
#define _OWLPS_POSITIONING_MINMAX_HH_
|
|
|
|
#include "trilaterationmethod.hh"
|
|
|
|
/// Multilaterates using the Lassabe's MinMax algorithm
|
|
class MinMax: public TrilaterationMethod
|
|
{
|
|
private:
|
|
float min ;
|
|
Point3D centre ;
|
|
std::tr1::unordered_map<AccessPoint*, float> const *ap_distances ;
|
|
|
|
void iterate(float x, float y, float z) ;
|
|
|
|
protected:
|
|
const Point3D start ;
|
|
const Point3D stop ;
|
|
float step ;
|
|
|
|
static const float MINMAX_DEFAULT_STEP = 0.5 ;
|
|
static const float INFINITE = 1000000 ;
|
|
|
|
public:
|
|
MinMax(const Point3D &_start,
|
|
const Point3D &_stop,
|
|
const float _step = MINMAX_DEFAULT_STEP):
|
|
min(INFINITE),
|
|
start(_start), stop(_stop), step(_step) {}
|
|
|
|
~MinMax(void) {}
|
|
|
|
Point3D trilaterate(
|
|
const std::tr1::unordered_map<AccessPoint*, float> &_ap_distances) ;
|
|
Point3D trilaterate_2d(
|
|
const std::tr1::unordered_map<AccessPoint*, float> &_ap_distances,
|
|
float z) ;
|
|
} ;
|
|
|
|
#endif // _OWLPS_POSITIONING_MINMAX_HH_
|