Wiselib
Public Types | Public Member Functions
wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P > Class Template Reference

Three-phase localization. More...

#include <distance_based_localization_base.h>

List of all members.

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.
SharedDatashared_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 ()

Detailed Description

template<typename OsModel_P, typename Radio_P, typename Timer_P, typename SharedData_P, typename DistanceModule_P, typename PositionModule_P, typename RefinementModule_P, typename Arithmatic_P, typename Debug_P = typename OsModel_P::Debug>
class wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >

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.


Member Typedef Documentation

template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
typedef Arithmatic_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::Arithmatic
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
typedef Debug_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::Debug
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_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
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
typedef OsModel_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::OsModel
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
typedef PositionModule_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::PositionModule
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
typedef Radio_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::Radio
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
typedef RefinementModule_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::RefinementModule
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
typedef SharedData_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::SharedData
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
typedef Timer_P wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::Timer

Member Enumeration Documentation

template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
enum wiselib::DistanceBasedLocalization::ErrorCodes
Enumerator:
SUCCESS 
ERR_UNSPEC 
ERR_NOTIMPL 

Constructor & Destructor Documentation

template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P >
wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::DistanceBasedLocalization ( )

Member Function Documentation

template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
bool wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::active ( void  ) [inline]
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P >
int wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::destruct ( void  )
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P >
int wiselib::DistanceBasedLocalization< OsModel_P, Radio_P, Timer_P, SharedData_P, DistanceModule_P, PositionModule_P, RefinementModule_P, Arithmatic_P, Debug_P >::init ( void  )
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P >
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 
)
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P >
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.

Returns:
true, if message is processed, false, if not.
See also:
shawn::Processor::process_message()
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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]
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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]
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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]
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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]
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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]
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P = typename OsModel_P::Debug>
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]
template<typename OsModel_P , typename Radio_P , typename Timer_P , typename SharedData_P , typename DistanceModule_P , typename PositionModule_P , typename RefinementModule_P , typename Arithmatic_P , typename Debug_P >
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.

See also:
shawn::Processor::work()

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