multilateration.h
Go to the documentation of this file.
#ifndef MULTILATERATION_H
#define MULTILATERATION_H
#include <itpp/itbase.h>
#include <itpp/itexports.h>
namespace itpp
{
class Algorithm;
struct Point;
class ITPP_EXPORT Multilateration
{
public:
enum Type {MULTI_FAILURE = -1,
MULTI_SPHERICAL,
MULTI_HYPERBOLIC,
MULTI_HYBRID
};
Multilateration() :
algo_(NULL), nb_fails_part(0), nb_fails_pos(0), type_(MULTI_FAILURE), method_(itpp::bvec()), bs_pos_(NULL), nb_bs_(0)
{}
Multilateration(const itpp::bvec &method,
const itpp::mat &bs_pos
) :
algo_(NULL), nb_fails_part(0), nb_fails_pos(0), type_(MULTI_FAILURE), method_(itpp::bvec()), bs_pos_(NULL), nb_bs_(0) {
setup(method, bs_pos);
}
virtual ~Multilateration();
void setup(const itpp::bvec &method,
const itpp::mat &bs_pos
) {
if((false == set_bs_pos(bs_pos)) || (false == set_method(method))) {
it_error("cannot init multilateration");
}
}
bool get_pos(itpp::vec &ms_pos,
const itpp::vec &measures
) {
return get_pos(ms_pos, measures._data());
}
bool get_pos(itpp::vec &ms_pos,
const itpp::mat &measures
) {
return get_pos(ms_pos, measures._data());
}
unsigned int get_nb_fails_part() const {
return nb_fails_part;
}
unsigned int get_nb_fails_pos() const {
return nb_fails_pos;
}
void reset_err_counters() {
nb_fails_part = 0;
nb_fails_pos = 0;
}
Type get_type() const {
return type_;
}
double get_crlb(const vec &ms_pos,
double sigma2
);
private:
bool get_pos(itpp::vec &ms_pos, const double *measures);
bool set_method(const itpp::bvec &method);
bool set_bs_pos(const itpp::mat &bs_pos);
bool hybrid2spherical(Point *bs_pos, double *meas);
bool partition(unsigned int **subsets_idx, unsigned int *subsets_nb, const Point *bs_pos, unsigned int nb_bs, unsigned int subset_len);
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);
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);
bool prod(double *out, const double *AT, const unsigned int *d, unsigned int cols, unsigned int rows);
Algorithm *algo_;
unsigned int nb_fails_part;
unsigned int nb_fails_pos;
Type type_;
itpp::bvec method_;
Point *bs_pos_;
unsigned int nb_bs_;
};
}
#endif
itpp::Array
General array class.
Definition array.h:105
itpp::Multilateration
Multilateration class for 3D indoor localization
Definition multilateration.h:86
itpp::Multilateration::get_pos
bool get_pos(itpp::vec &ms_pos, const itpp::mat &measures)
Computes the mobile station position for hyperbolic multilateration.
Definition multilateration.h:152
itpp::Multilateration::Type
Type
Multilateration types as detected from user input (method binary vector)
Definition multilateration.h:89
itpp::Multilateration::MULTI_HYPERBOLIC
@ MULTI_HYPERBOLIC
hyperbolic multilateration
Definition multilateration.h:91
itpp::Multilateration::MULTI_SPHERICAL
@ MULTI_SPHERICAL
spherical multilateration
Definition multilateration.h:90
itpp::Multilateration::get_pos
bool get_pos(itpp::vec &ms_pos, const itpp::vec &measures)
Computes the mobile station position for spherical and hybrid multilateration.
Definition multilateration.h:142
itpp::Multilateration::get_nb_fails_part
unsigned int get_nb_fails_part() const
Gets the number of failures of the partitioning algorithm used internally by the ML-estimator.
Definition multilateration.h:158
itpp::Multilateration::Multilateration
Multilateration(const itpp::bvec &method, const itpp::mat &bs_pos)
Multilateration class constructor
Definition multilateration.h:106
itpp::Multilateration::Multilateration
Multilateration()
Multilateration class default constructor
Definition multilateration.h:95
itpp::Multilateration::get_type
Type get_type() const
Gets the type of the multilateration method currently used by the ML-estimator.
Definition multilateration.h:171
itpp::Multilateration::setup
void setup(const itpp::bvec &method, const itpp::mat &bs_pos)
Setup function for specifying the multilateration method and the base station positions.
Definition multilateration.h:124
itpp::Multilateration::get_nb_fails_pos
unsigned int get_nb_fails_pos() const
Gets the number of failures of the positioning algorithm used internally by the ML-estimator.
Definition multilateration.h:162
itpp::Multilateration::reset_err_counters
void reset_err_counters()
Resets the error counters (number of failures for the partitioning and positioning algorithms)
Definition multilateration.h:166
it_error
#define it_error(s)
Abort unconditionally.
Definition itassert.h:126
itpp::prod
T prod(const Vec< T > &v)
The product of all elements in the vector.
Definition matfunc.h:195
itbase.h
Include file for the IT++ base module.
itpp
itpp namespace
Definition itmex.h:37

Generated on Mon Jun 10 2024 11:49:22 for IT++ by Doxygen 1.9.8