Wiselib
Public Types
wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P > Class Template Reference

Basic localization module to act with LocalizationProcessor. More...

#include <localization_module.h>

Inherited by wiselib::LocalizationDvHopModule< OsModel_P, Radio_P, Clock_P, Debug_P, SharedData_P, NodeSet_P, Arithmatic_P >, wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >, wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >, wiselib::LocalizationGpsFreeNcsModule< OsModel_P, Radio_P, Clock_P, Debug_P, SharedData_P >, wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >, wiselib::LocalizationLaterationModule< OsModel_P, Radio_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationMinMaxModule< OsModel_P, Radio_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationNopModule< OsModel_P, Radio_P, SharedData_P >, and wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >.

List of all members.

Public Types

typedef OsModel_P OsModel
typedef Radio_P Radio
typedef SharedData_P SharedData
typedef LocalizationModule
< OsModel, Radio, SharedData
self_type
typedef Radio::size_t size_t
typedef Radio::node_id_t node_id_t
typedef Radio::block_data_t block_data_t
typedef SharedData::Neighborhood Neighborhood
typedef
SharedData::LocalCoordinateSystem 
LocalCoordinateSystem

Public Member Functions

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)

Detailed Description

template<typename OsModel_P, typename Radio_P, typename SharedData_P>
class wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >

Basic localization module to act with LocalizationProcessor.

This is the basic localization module which has to be implemented if someone wants to add a new algorithm.

Functionality is like a Processor. There are the same methods boot(), process_message() and work(), which are called by the LocalizationProcessor. Each LocalizationProcessor owns two LocalizationModules; one for distance phase (get distance to anchors) and one for refinement phase (calibrating the estimated position). Moreover the modules are able to send messages by the method send().

Particularly a distance module has to work on given neighborhood(), because the LocalizationProcessor uses it to estimate it's position.

If the distance phase finished, method finished() has to return true, so that the LocalizationProcessor is able to estimate it's position. Same with a refinement module to make the LocalizationProcessor able to deactivate itself.

Boot method which is called once on startup. void enable( void )

This method is called if the LocalizationProcessor receives a message and forward it to the modules. void receive( node_id_t from, size_t len, block_data_t *data )

This method is called once each simulation round as long as the module is not finished.

Moreover a refinement module's method is not called until the distance module is finished. void work( void )

This method is called if there is a rollback_period given and reached. This is done in most cases, because the nodes are mobile, so that they change their position.

The easiest way of implementation would be to just reset all information. void rollback( void )

returns true, if module is finished. false otherwise bool finished( void )

This method sets the shared data object, which can be accessed by all available modules. void set_shared_data( SharedData& shared_data )


Member Typedef Documentation

template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef Radio::block_data_t wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::block_data_t
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef SharedData::LocalCoordinateSystem wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::LocalCoordinateSystem
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef SharedData::Neighborhood wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::Neighborhood
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef Radio::node_id_t wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::node_id_t
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef OsModel_P wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::OsModel
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef Radio_P wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::Radio
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef LocalizationModule<OsModel, Radio, SharedData> wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::self_type
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef SharedData_P wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::SharedData
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef Radio::size_t wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::size_t

Member Function Documentation

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

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

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