IT++ Logo
multilateration.h
Go to the documentation of this file.
1 
29 #ifndef MULTILATERATION_H
30 #define MULTILATERATION_H
31 
32 #include <itpp/itbase.h>
33 #include <itpp/itexports.h>
34 
35 namespace itpp
36 {
37 
38 class Algorithm;
39 struct Point;
40 
85 class ITPP_EXPORT Multilateration
86 {
87 public:
89  enum Type {MULTI_FAILURE = -1,
92  MULTI_HYBRID
93  };
96  algo_(NULL), nb_fails_part(0), nb_fails_pos(0), type_(MULTI_FAILURE), method_(itpp::bvec()), bs_pos_(NULL), nb_bs_(0)
97  {}
99 
106  Multilateration(const itpp::bvec &method,
107  const itpp::mat &bs_pos
108  ) :
109  algo_(NULL), nb_fails_part(0), nb_fails_pos(0), type_(MULTI_FAILURE), method_(itpp::bvec()), bs_pos_(NULL), nb_bs_(0) {
110  setup(method, bs_pos);
111  }
113  virtual ~Multilateration();
115 
124  void setup(const itpp::bvec &method,
125  const itpp::mat &bs_pos
126  ) {
127  if((false == set_bs_pos(bs_pos)) || (false == set_method(method))) {
128  it_error("cannot init multilateration");
129  }
130  }
132 
142  bool get_pos(itpp::vec &ms_pos,
143  const itpp::vec &measures
144  ) {
145  return get_pos(ms_pos, measures._data());
146  }
148 
152  bool get_pos(itpp::vec &ms_pos,
153  const itpp::mat &measures
154  ) {
155  return get_pos(ms_pos, measures._data());
156  }
158  unsigned int get_nb_fails_part() const {
159  return nb_fails_part;
160  }
162  unsigned int get_nb_fails_pos() const {
163  return nb_fails_pos;
164  }
167  nb_fails_part = 0;
168  nb_fails_pos = 0;
169  }
171  Type get_type() const {
172  return type_;
173  }
175  double get_crlb(const vec &ms_pos,
176  double sigma2
177  );
178 private:
180  bool get_pos(itpp::vec &ms_pos, const double *measures);
182  bool set_method(const itpp::bvec &method);
184  bool set_bs_pos(const itpp::mat &bs_pos);
186  bool hybrid2spherical(Point *bs_pos, double *meas);
187  bool partition(unsigned int **subsets_idx, unsigned int *subsets_nb, const Point *bs_pos, unsigned int nb_bs, unsigned int subset_len);
189  bool get_ml_pos(Point *ms_pos, const Point *bs_pos, unsigned int nb_bs, const unsigned int *subsets_idx, unsigned int subsets_nb, unsigned int subset_len);
191  bool get_bs_pos_subset(Point *bs_pos_subset, const Point *bs_pos, unsigned int nb_bs, const unsigned int *subset_idx, unsigned int subset_len);
193  bool prod(double *out, const double *AT, const unsigned int *d, unsigned int cols, unsigned int rows);
194  Algorithm *algo_;
195  unsigned int nb_fails_part;
196  unsigned int nb_fails_pos;
197  Type type_;
198  itpp::bvec method_;
199  Point *bs_pos_;
200  unsigned int nb_bs_;
201 };
202 
203 }
204 
205 #endif
bool get_pos(itpp::vec &ms_pos, const itpp::mat &measures)
Computes the mobile station position for hyperbolic multilateration.
Multilateration(const itpp::bvec &method, const itpp::mat &bs_pos)
Multilateration class constructor
T prod(const Vec< T > &v)
The product of all elements in the vector.
Definition: matfunc.h:195
void setup(const itpp::bvec &method, const itpp::mat &bs_pos)
Setup function for specifying the multilateration method and the base station positions.
Multilateration class for 3D indoor localization
Type get_type() const
Gets the type of the multilateration method currently used by the ML-estimator.
itpp namespace
Definition: itmex.h:36
unsigned int get_nb_fails_pos() const
Gets the number of failures of the positioning algorithm used internally by the ML-estimator.
Include file for the IT++ base module.
unsigned int get_nb_fails_part() const
Gets the number of failures of the partitioning algorithm used internally by the ML-estimator.
Type
Multilateration types as detected from user input (method binary vector)
void reset_err_counters()
Resets the error counters (number of failures for the partitioning and positioning algorithms) ...
bool get_pos(itpp::vec &ms_pos, const itpp::vec &measures)
Computes the mobile station position for spherical and hybrid multilateration.
#define it_error(s)
Abort unconditionally.
Definition: itassert.h:126
Multilateration()
Multilateration class default constructor

Generated on Thu Jun 21 2018 16:06:18 for IT++ by Doxygen 1.8.13