2012-02-06 16:44:09 +01:00
|
|
|
/*
|
2013-05-29 18:43:35 +02:00
|
|
|
* This file is part of the Owl Positioning System (OwlPS) project.
|
|
|
|
* It is subject to the copyright notice and license terms in the
|
|
|
|
* COPYRIGHT.t2t file found in the top-level directory of this
|
|
|
|
* distribution and at
|
|
|
|
* http://code.lm7.fr/p/owlps/source/tree/master/COPYRIGHT.t2t
|
|
|
|
* No part of the OwlPS Project, including this file, may be copied,
|
|
|
|
* modified, propagated, or distributed except according to the terms
|
|
|
|
* contained in the COPYRIGHT.t2t file; the COPYRIGHT.t2t file must be
|
|
|
|
* distributed along with this file, either separately or by replacing
|
2013-06-22 23:30:17 +02:00
|
|
|
* this notice by the COPYRIGHT.t2t file's contents.
|
2012-02-06 16:44:09 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-03-22 13:47:19 +01:00
|
|
|
#ifndef _OWLPS_POSITIONING_MINMAX_HH_
|
|
|
|
#define _OWLPS_POSITIONING_MINMAX_HH_
|
|
|
|
|
2012-04-11 16:31:48 +02:00
|
|
|
#include "trilaterationmethod.hh"
|
2010-03-22 13:47:19 +01:00
|
|
|
|
|
|
|
/// Multilaterates using the Lassabe's MinMax algorithm
|
2012-04-11 16:31:48 +02:00
|
|
|
class MinMax: public TrilaterationMethod
|
2010-03-22 13:47:19 +01:00
|
|
|
{
|
2010-06-14 17:15:48 +02:00
|
|
|
private:
|
|
|
|
float min ;
|
|
|
|
Point3D centre ;
|
2013-10-02 20:38:45 +02:00
|
|
|
std::unordered_map<const CapturePoint*, float> const *cp_distances ;
|
2010-06-14 17:15:48 +02:00
|
|
|
|
2013-10-02 20:38:45 +02:00
|
|
|
void iterate(const float x, const float y, const float z) ;
|
2010-06-14 17:15:48 +02:00
|
|
|
|
2010-03-22 13:47:19 +01:00
|
|
|
protected:
|
2010-04-16 09:33:03 +02:00
|
|
|
const Point3D start ;
|
|
|
|
const Point3D stop ;
|
2010-03-22 13:47:19 +01:00
|
|
|
float step ;
|
|
|
|
|
2013-05-16 23:42:37 +02:00
|
|
|
static constexpr float MINMAX_DEFAULT_STEP = 0.5 ;
|
|
|
|
static constexpr float INFINITE = 1000000 ;
|
2010-03-22 13:47:19 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
MinMax(const Point3D &_start,
|
|
|
|
const Point3D &_stop,
|
|
|
|
const float _step = MINMAX_DEFAULT_STEP):
|
2010-06-22 09:34:17 +02:00
|
|
|
min(INFINITE),
|
2010-03-22 13:47:19 +01:00
|
|
|
start(_start), stop(_stop), step(_step) {}
|
|
|
|
|
|
|
|
~MinMax(void) {}
|
|
|
|
|
2012-04-11 16:31:48 +02:00
|
|
|
Point3D trilaterate(
|
2013-10-02 20:38:45 +02:00
|
|
|
const std::unordered_map<const CapturePoint*, float> &_cp_distances) ;
|
2012-04-11 16:31:48 +02:00
|
|
|
Point3D trilaterate_2d(
|
2013-10-02 20:38:45 +02:00
|
|
|
const std::unordered_map<const CapturePoint*, float> &_cp_distances,
|
2010-06-14 17:15:48 +02:00
|
|
|
float z) ;
|
2010-03-22 13:47:19 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
#endif // _OWLPS_POSITIONING_MINMAX_HH_
|