Wiselib
|
Module implementing refinement by iterative lateration. More...
#include <localization_iter_lateration_module.h>
Inherits wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
Public Types | |
typedef OsModel_P | OsModel |
typedef Radio_P | Radio |
typedef Distance_P | Distance |
typedef Debug_P | Debug |
typedef SharedData_P | SharedData |
typedef LocalizationIterLaterationModule < OsModel, Radio, Distance, Debug, SharedData > | self_type |
typedef LocalizationModule < OsModel, Radio, SharedData > | base_type |
typedef Radio::size_t | size_t |
typedef Radio::node_id_t | node_id_t |
typedef Radio::block_data_t | block_data_t |
typedef LocalizationIterLaterationMessage < OsModel, Radio > | IterLaterationMessage |
typedef LocalizationIterLaterationSoundMessage < OsModel, Radio > | IterLaterationSoundMessage |
typedef SharedData::NeighborInfoList | NeighborInfoList |
typedef SharedData::Neighborhood::NeighborhoodIterator | NeighborhoodIterator |
typedef SharedData::Neighborhood | Neighborhood |
typedef SharedData::LocalCoordinateSystem | LocalCoordinateSystem |
Public Member Functions | |
void | rollback (void) |
void | init (Radio &radio, Debug &debug, SharedData &shared_data, Distance &distance) |
construction / destruction | |
LocalizationIterLaterationModule () | |
~LocalizationIterLaterationModule () | |
standard methods startup/simulation steps | |
void | receive (node_id_t from, size_t len, block_data_t *data) |
Handling of Iter-Lateration-Messages. | |
void | work (void) |
Check, whether state can be set to finished or not. | |
module status info | |
bool | finished (void) |
Parameter Configuration | |
void | set_iteration_limit (int iteration_limit) |
Maximum number of iterations in refinement phase. | |
void | set_min_confident_nbrs (int min_confident_nbrs) |
Minimum of confident neighbors to start refinement. | |
void | set_twin_measure (double twin_measure) |
Percentage of communication range. | |
void | set_abort_pos_update (double abort_pos_update) |
Percentage of communication range. | |
void | set_res_acceptance (double res_acceptance) |
If residuen check of lateration fails, there is a given chance, namely res_acceptance, to accept the result anyway. | |
basic access to owner, observer, neighborhood and local coordinate system | |
void | set_shared_data (SharedData &shared_data) |
This method sets the shared data object, which can be accessed by all available modules. | |
SharedData & | shared_data (void) |
Neighborhood & | neighborhood (void) |
LocalCoordinateSystem & | local_coord_sys (void) |
Protected Member Functions | |
processing iterative lateration messages | |
bool | process_iter_lateration_sound_message (node_id_t from, size_t len, block_data_t *data) |
This method processes sound messages. | |
bool | process_iter_lateration_message (node_id_t from, size_t len, block_data_t *data) |
This method processes normal messages. | |
main refinement step | |
void | iter_lateration_step (void) |
This method executes the iterative lateration step. |
Module implementing refinement by iterative lateration.
This module implements refinement by iterative lateration. Idea is to take into account all neighbors, respectively their distances and positions, and start lateration with this information. After that the new position is broadcasted, so that neighbors are able to start lateration again with this new data, and so on.
The process finished, either after a given number of steps, or, if the position update becomes very small.
Main problem of this procedere are nodes with inaccurate information. To filter out most of these cases, there are different methods.
At first, there is the use of confidences. This means, that every node is associated with a special confidence level between 0 and 1. Unknowns start with a low confidence like 0.1, anchors with a high one like 1. These values are used in the lateration by a weighted least squares approach. Instead of solving , is solved, where is the vector of confidences. After a successful lateration a node sets its confidence to the average of its neighbors confidences. This will, in general, increase the confidence level.
Second issue is filtering out ill-connected nodes.
To take part in refinement phase, a node has to be sound. This means, that there are independent references to at least three/four anchors. That is, information about anchors has to be get from different neighbors. Moreover, if a node becomes sound, it sends this out. The neighbors again receiving this information, add the sound node to an own list, so that an unsound node is able to become sound, if the size of intersection between sound and references becomes greater or equal three/four.
Third, the twin neighbors should be filtered out. This means, that one neighbor, that is very close to another, is set to be a twin and is ignored in further computation. The twin check has to be done in every iteration, because in most cases their position change.
At least, there is the residuen check to check the validity of the new position. To avoid being trapped in a local minimum, there is a given chance to accept a failed check anyway. If this happens, the confidence of affected node is reduced by 50 percent.
typedef LocalizationModule<OsModel, Radio, SharedData> wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::base_type |
typedef Radio::block_data_t wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::block_data_t |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef Debug_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::Debug |
typedef Distance_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::Distance |
typedef LocalizationIterLaterationMessage<OsModel, Radio> wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::IterLaterationMessage |
typedef LocalizationIterLaterationSoundMessage<OsModel, Radio> wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::IterLaterationSoundMessage |
typedef SharedData::LocalCoordinateSystem wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::LocalCoordinateSystem [inherited] |
typedef SharedData::Neighborhood wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::Neighborhood |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef SharedData::Neighborhood::NeighborhoodIterator wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::NeighborhoodIterator |
typedef SharedData::NeighborInfoList wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::NeighborInfoList |
typedef Radio::node_id_t wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::node_id_t |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef OsModel_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::OsModel |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef Radio_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::Radio |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef LocalizationIterLaterationModule<OsModel, Radio, Distance, Debug, SharedData> wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::self_type |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef SharedData_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::SharedData |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef Radio::size_t wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::size_t |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::LocalizationIterLaterationModule | ( | ) |
wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::~LocalizationIterLaterationModule | ( | ) |
bool wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::finished | ( | void | ) |
true
, if module is finished. false
otherwise void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::init | ( | Radio & | radio, |
Debug & | debug, | ||
SharedData & | shared_data, | ||
Distance & | distance | ||
) | [inline] |
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::iter_lateration_step | ( | void | ) | [protected] |
This method executes the iterative lateration step.
There are passed all checks mentioned in the Detailed Description above.
LocalCoordinateSystem& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::local_coord_sys | ( | void | ) | [inline, inherited] |
Neighborhood& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::neighborhood | ( | void | ) | [inline, inherited] |
bool wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::process_iter_lateration_message | ( | node_id_t | from, |
size_t | len, | ||
block_data_t * | data | ||
) | [protected] |
This method processes normal messages.
The received information is updated in own neighborhood.
bool wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::process_iter_lateration_sound_message | ( | node_id_t | from, |
size_t | len, | ||
block_data_t * | data | ||
) | [protected] |
This method processes sound messages.
Message source is added to sound nodes and, if necessary, the sound check is started again.
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::receive | ( | node_id_t | from, |
size_t | len, | ||
block_data_t * | data | ||
) |
Handling of Iter-Lateration-Messages.
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::rollback | ( | void | ) |
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::set_abort_pos_update | ( | double | abort_pos_update | ) | [inline] |
Percentage of communication range.
decides, if new position is very close to old one, whether the refinement phase is finished or not after position update. Default 0.001.
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::set_iteration_limit | ( | int | iteration_limit | ) | [inline] |
Maximum number of iterations in refinement phase.
Default 5.
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::set_min_confident_nbrs | ( | int | min_confident_nbrs | ) | [inline] |
Minimum of confident neighbors to start refinement.
Default 5.
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::set_res_acceptance | ( | double | res_acceptance | ) | [inline] |
If residuen check of lateration fails, there is a given chance, namely res_acceptance, to accept the result anyway.
This happens, to avoid being trapped in some local mimina. Default 0.1.
void wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::set_shared_data | ( | SharedData & | shared_data | ) | [inline, inherited] |
This method sets the shared data object, which can be accessed by all available modules.
LocalizationSharedData | Shared data between all modules. |
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::set_twin_measure | ( | double | twin_measure | ) | [inline] |
Percentage of communication range.
This parameter is taken to decide, whether a neighbor is twin or not. Default 0.1.
SharedData& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::shared_data | ( | void | ) | [inline, inherited] |
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::work | ( | void | ) |
Check, whether state can be set to finished or not.
Moreover, send initial messages and check on first pass, whether node is sound or not.