Wiselib
Public Types | Public Member Functions
wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P > Class Template Reference

Module implementing refinement by iterative lateration. More...

#include <localization_iter_lateration_module.h>

Inherits wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.

List of all members.

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.
SharedDatashared_data (void)
Neighborhoodneighborhood (void)
LocalCoordinateSystemlocal_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.

Detailed Description

template<typename OsModel_P, typename Radio_P, typename Distance_P, typename Debug_P, typename SharedData_P>
class wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >

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 $ Ax = b$, $ \omega Ax = \omega b$ is solved, where $\omega$ 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.


Member Typedef Documentation

template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef LocalizationModule<OsModel, Radio, SharedData> wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::base_type
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Radio::block_data_t wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::block_data_t
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Debug_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::Debug
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Distance_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::Distance
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef LocalizationIterLaterationMessage<OsModel, Radio> wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::IterLaterationMessage
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef LocalizationIterLaterationSoundMessage<OsModel, Radio> wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::IterLaterationSoundMessage
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef SharedData::LocalCoordinateSystem wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::LocalCoordinateSystem [inherited]
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef SharedData::Neighborhood wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::Neighborhood
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef SharedData::Neighborhood::NeighborhoodIterator wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::NeighborhoodIterator
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef SharedData::NeighborInfoList wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::NeighborInfoList
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Radio::node_id_t wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::node_id_t
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef OsModel_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::OsModel
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Radio_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::Radio
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef LocalizationIterLaterationModule<OsModel, Radio, Distance, Debug, SharedData> wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::self_type
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef SharedData_P wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::SharedData
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Radio::size_t wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::size_t

Constructor & Destructor Documentation

template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::LocalizationIterLaterationModule ( )
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::~LocalizationIterLaterationModule ( )

Member Function Documentation

template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
bool wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::finished ( void  )
Returns:
true, if module is finished. false otherwise
See also:
LocalizationModule::finished()
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::init ( Radio radio,
Debug debug,
SharedData shared_data,
Distance distance 
) [inline]
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

template<typename OsModel_P , typename Radio_P , typename SharedData_P >
LocalCoordinateSystem& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::local_coord_sys ( void  ) [inline, inherited]
Returns:
Writable shared LocalizationLocalCoordinateSystem.
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
Neighborhood& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::neighborhood ( void  ) [inline, inherited]
Returns:
Writable shared LocalizationNeighborhood.
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

See also:
LocalizationIterLaterationMessage
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

See also:
LocalizationIterLaterationSoundMessage
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

See also:
LocalizationModule::process_message()
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >::rollback ( void  )
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

template<typename OsModel_P , typename Radio_P , typename SharedData_P >
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.

Parameters:
LocalizationSharedDataShared data between all modules.
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

template<typename OsModel_P , typename Radio_P , typename SharedData_P >
SharedData& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::shared_data ( void  ) [inline, inherited]
Returns:
LocalizationSharedData shared by all modules.
writable LocalizationSharedData shared by all modules.
template<typename OsModel_P , typename Radio_P , typename Distance_P , typename Debug_P , typename SharedData_P >
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.

See also:
LocalizationModule::work()

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines