Wiselib
|
Three-phase localization. More...
#include <distance_based_localization_base.h>
Public Types | |
enum | ErrorCodes { SUCCESS = OsModel::SUCCESS, ERR_UNSPEC = OsModel::ERR_UNSPEC, ERR_NOTIMPL = OsModel::ERR_NOTIMPL } |
typedef OsModel_P | OsModel |
typedef DistanceModule_P | DistanceModule |
typedef PositionModule_P | PositionModule |
typedef RefinementModule_P | RefinementModule |
typedef Radio_P | Radio |
typedef Timer_P | Timer |
typedef Debug_P | Debug |
typedef SharedData_P | SharedData |
typedef Arithmatic_P | Arithmatic |
typedef Vec< Arithmatic_P > | position_t |
typedef DistanceBasedLocalization < OsModel, Radio, Timer, SharedData, DistanceModule, PositionModule, RefinementModule, Arithmatic,Debug > | self_type |
typedef Radio::size_t | size_t |
typedef Radio::node_id_t | node_id_t |
typedef Radio::block_data_t | block_data_t |
Public Member Functions | |
int | init (Radio &radio, Timer &timer, Debug &debug, SharedData &shared_data, DistanceModule &dist_module, PositionModule &pos_module, RefinementModule &ref_module) |
int | init (void) |
int | destruct (void) |
void | receive (node_id_t from, size_t len, block_data_t *data) |
At first, this method checks, if the message should gone lost. | |
void | work (void *data) |
TODO: modules had been renewed! At first, this method executes the work method of both distance and refinement module. | |
SharedData & | shared_data (void) |
void | set_anchor (bool anchor) |
void | set_confidence (Arithmatic confidence) |
void | set_position (const Vec< Arithmatic_P > &position) |
void | set_active (bool active) |
bool | active (void) |
void | roll_back (void) |
construction | |
DistanceBasedLocalization () |
Three-phase localization.
There are anchorbased and anchorless algorithms. Anchorbased means, that unknown nodes, which do not know their position, need some nodes in the topology, which know their position. Anchorless algorithms build a relative coordinate system without the need of position aware nodes. Generally you should not mix these algorithms because potentially there will be no result.
Localization is cut in three phases depending on using anchors or not.
Anchorbased: At first, unknown nodes try to estimate their distance to the anchors. Second, with the resulting information the position is calculated. Third, an optional one, the estimated position is calibrated, e.g. with help of neighbors information.
Anchorless: At first, nodes try to get information about their neighborhood and build a local coordinate system. Second, they will build a global, or rather network, coordinate system. Third phase is an optional one where the positions and coordinate systems are calibrated.
The algorithms are not designed for mobility primary, but there is a chance to do so. In general each phase is processed one time before the processor deactivate itself. Therefor you could give an rollback number, which rerun the phases after the given number of rounds. Moreover there is an rollback_limit which limit the number of maximal rollbacks.
The algorithms are implemented in so called modules, one designed for each algorithm in each phase. All algorithms and calculations work on the same neighborhood.
typedef Arithmatic_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::Arithmatic |
typedef Radio::block_data_t wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::block_data_t |
typedef Debug_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::Debug |
typedef DistanceModule_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::DistanceModule |
typedef Radio::node_id_t wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::node_id_t |
typedef OsModel_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::OsModel |
typedef Vec<Arithmatic_P> wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::position_t |
typedef PositionModule_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::PositionModule |
typedef Radio_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::Radio |
typedef RefinementModule_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::RefinementModule |
typedef DistanceBasedLocalization<OsModel, Radio, Timer, SharedData, DistanceModule, PositionModule, RefinementModule,Arithmatic ,Debug> wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::self_type |
typedef SharedData_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::SharedData |
typedef Radio::size_t wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::size_t |
typedef Timer_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::Timer |
enum wiselib::DistanceBasedLocalization::ErrorCodes |
wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::DistanceBasedLocalization | ( | ) |
bool wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::active | ( | void | ) | [inline] |
int wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::destruct | ( | void | ) |
int wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::init | ( | void | ) |
int wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::init | ( | Radio & | radio, |
Timer & | timer, | ||
Debug & | debug, | ||
SharedData & | shared_data, | ||
DistanceModule & | dist_module, | ||
PositionModule & | pos_module, | ||
RefinementModule & | ref_module | ||
) |
void wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::receive | ( | node_id_t | from, |
size_t | len, | ||
block_data_t * | data | ||
) |
At first, this method checks, if the message should gone lost.
If not, message is forwarded to distance and refinement module.
true
, if message is processed, false
, if not. void wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::roll_back | ( | void | ) | [inline] |
void wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::set_active | ( | bool | active | ) | [inline] |
void wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::set_anchor | ( | bool | anchor | ) | [inline] |
void wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::set_confidence | ( | Arithmatic | confidence | ) | [inline] |
void wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::set_position | ( | const Vec< Arithmatic_P > & | position | ) | [inline] |
SharedData& wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::shared_data | ( | void | ) | [inline] |
void wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::work | ( | void * | data | ) |
TODO: modules had been renewed! At first, this method executes the work method of both distance and refinement module.
Second, if the distance phase is finished, this method tries to estimate the node's position.