Wiselib
|
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 >.
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. | |
SharedData & | shared_data (void) |
Neighborhood & | neighborhood (void) |
LocalCoordinateSystem & | local_coord_sys (void) |
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 )
typedef Radio::block_data_t wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::block_data_t |
Reimplemented in 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::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationNopModule< OsModel_P, Radio_P, SharedData_P >, wiselib::LocalizationGpsFreeNcsModule< OsModel_P, Radio_P, Clock_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 >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
typedef SharedData::LocalCoordinateSystem wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::LocalCoordinateSystem |
typedef SharedData::Neighborhood wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::Neighborhood |
Reimplemented in wiselib::LocalizationLaterationModule< OsModel_P, Radio_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationMinMaxModule< OsModel_P, Radio_P, Debug_P, SharedData_P, Arithmatic_P >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
typedef Radio::node_id_t wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::node_id_t |
Reimplemented in 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::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationNopModule< OsModel_P, Radio_P, SharedData_P >, wiselib::LocalizationGpsFreeNcsModule< OsModel_P, Radio_P, Clock_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 >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
typedef OsModel_P wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::OsModel |
Reimplemented in 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::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationNopModule< OsModel_P, Radio_P, SharedData_P >, wiselib::LocalizationGpsFreeNcsModule< OsModel_P, Radio_P, Clock_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 >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
typedef Radio_P wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::Radio |
Reimplemented in 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::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationNopModule< OsModel_P, Radio_P, SharedData_P >, wiselib::LocalizationGpsFreeNcsModule< OsModel_P, Radio_P, Clock_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 >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
typedef LocalizationModule<OsModel, Radio, SharedData> wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::self_type |
Reimplemented in 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::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationNopModule< OsModel_P, Radio_P, SharedData_P >, wiselib::LocalizationGpsFreeNcsModule< OsModel_P, Radio_P, Clock_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 >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
typedef SharedData_P wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::SharedData |
Reimplemented in 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::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationNopModule< OsModel_P, Radio_P, SharedData_P >, wiselib::LocalizationGpsFreeNcsModule< OsModel_P, Radio_P, Clock_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 >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
typedef Radio::size_t wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::size_t |
Reimplemented in 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::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationNopModule< OsModel_P, Radio_P, SharedData_P >, wiselib::LocalizationGpsFreeNcsModule< OsModel_P, Radio_P, Clock_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 >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
LocalCoordinateSystem& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::local_coord_sys | ( | void | ) | [inline] |
Neighborhood& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::neighborhood | ( | void | ) | [inline] |
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.
LocalizationSharedData | Shared data between all modules. |
SharedData& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::shared_data | ( | void | ) | [inline] |