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

Module that implements GPS-free Local Coordinate System building. More...

#include <localization_gpsfree_lcs_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 Clock_P Clock
typedef Distance_P Distance
typedef Debug_P Debug
typedef SharedData_P SharedData
typedef
LocalizationGpsFreeLcsModule
< OsModel, Radio, Clock,
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 Clock_P::time_t time_t
typedef SharedData::DistanceMap DistanceMap
typedef
SharedData::LocalCoordinateSystem 
LocalCoordinateSystem
typedef
SharedData::Neighborhood::NeighborhoodIterator 
NeighborhoodIterator
typedef
LocalizationGpsFreeLcsInitMessage
< OsModel, Radio
GpsFreeLcsInitMessage
typedef
LocalizationGpsFreeLcsNeighborMessage
< OsModel, Radio, DistanceMap
GpsFreeLcsNeighborMessage
typedef SharedData::Neighborhood Neighborhood

Public Member Functions

void rollback (void)
void init (Radio &radio, Clock &clock, Debug &debug, SharedData &shared_data, Distance &distance)
construction / destruction
 LocalizationGpsFreeLcsModule ()
 ~LocalizationGpsFreeLcsModule ()
standard methods startup/simulation steps
void receive (node_id_t from, size_t len, block_data_t *data)
 Handling of GPS-free-LCS-Messages.
void work (void)
 Check, whether state can be set to finished or not.
module status info
bool finished (void)
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 gpsfree lcs messages
bool process_gpsfree_lcs_init_message (node_id_t from, size_t len, block_data_t *data)
 This method processes initial messages.
void broadcast_neighborhood (void)
 This method broadcasts the neighborhood generated by the initial messages.
bool process_gpsfree_lcs_neighbor_message (node_id_t from, size_t len, block_data_t *data)
 This method processes neighborhood messages.
work
void build_lcs (void)
 Build a local coordinate system just like described in the paper.
initial methods
void set_lcs_epsilon (double epsilon)
 Read the given parameters, which have been set via simulator commands or configuration file.

Detailed Description

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

Module that implements GPS-free Local Coordinate System building.

This module implements the algorithm to get a local coordinate system just like described in GPS-free positioning in moblie ad hoc networks by Capkun, Hamdi, Hubeaux.

At first nodes build their 2-hop neighborhood by sending an initial message, receive initial messages from neighbors and send again a message contending constructed neighborhood to surrounding nodes.

After that nodes build their local coordinate system. [...]


Comment by the author This is not a full implementation of the above mentioned paper. Up to now there are two parts missing: On the one hand (just a little thing) the computation per triangulation of unknown nodes (the stuff with the node k, which is not neighbor of p and q and should be computed by using the position of node i and two other nodes for which the positions are already obtained) has not be done. On the other hand (the big part) the whole stuff with the Location Reference Group is still missing.

I think, that these parts are useless unless the algorithm has been optimized in two ways. First the nearly unrelevant one: By choosing nodes p and q to maximize the number of regular nodes in the LVS (see LocalizationGpsFreeLcsModule<OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P>::build_lcs()), the "up-to-now-solution" is a very unfortunaletly one, because the computation overhead is really big. Second (in my opinion the main argument against using this algorithm unless there appears a better solution) there is a problem with the triangulisation in the paper (see formula (3), deciding, on which side of the x-axis a node is located) and errors in distance measurement. The author mentioned, that the two angles can not be equal in practice and that some differences should be tolerated. Unfortunaletly I hadn't found any epsilon leading to satisfactorily solutions. Maybe it is an approach to look at the papers of K. Langendoen and D. Niculesco and their handling of the similar "euclidean-problem".


Member Typedef Documentation

template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef LocalizationModule<OsModel, Radio, SharedData> wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::base_type
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Radio::block_data_t wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::block_data_t
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Clock_P wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::Clock
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Debug_P wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::Debug
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Distance_P wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::Distance
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef SharedData::DistanceMap wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::DistanceMap
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef LocalizationGpsFreeLcsInitMessage<OsModel, Radio> wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::GpsFreeLcsInitMessage
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef LocalizationGpsFreeLcsNeighborMessage<OsModel, Radio, DistanceMap> wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::GpsFreeLcsNeighborMessage
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef SharedData::LocalCoordinateSystem wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_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 [inherited]
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef SharedData::Neighborhood::NeighborhoodIterator wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::NeighborhoodIterator
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Radio::node_id_t wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::node_id_t
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef OsModel_P wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::OsModel
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Radio_P wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::Radio
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef LocalizationGpsFreeLcsModule<OsModel, Radio, Clock, Distance, Debug, SharedData> wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::self_type
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef SharedData_P wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::SharedData
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Radio::size_t wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::size_t
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
typedef Clock_P::time_t wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::time_t

Constructor & Destructor Documentation

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

Member Function Documentation

template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::broadcast_neighborhood ( void  ) [protected]

This method broadcasts the neighborhood generated by the initial messages.

See also:
LocalizationEuclideanNeighborMessage
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::build_lcs ( void  ) [protected]

Build a local coordinate system just like described in the paper.

template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
bool wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_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 Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::init ( Radio radio,
Clock clock,
Debug debug,
SharedData shared_data,
Distance distance 
) [inline]
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 Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
bool wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::process_gpsfree_lcs_init_message ( node_id_t  from,
size_t  len,
block_data_t data 
) [protected]

This method processes initial messages.

Source of message is added to neighborhood.

See also:
LocalizationEuclideanInitMessage
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
bool wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::process_gpsfree_lcs_neighbor_message ( node_id_t  from,
size_t  len,
block_data_t data 
) [protected]

This method processes neighborhood messages.

The neighbors of message source are added to neighborhood.

See also:
LocalizationEuclideanNeighborMessage
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::receive ( node_id_t  from,
size_t  len,
block_data_t data 
)

Handling of GPS-free-LCS-Messages.

See also:
LocalizationModule::process_message()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::rollback ( void  )
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::set_lcs_epsilon ( double  epsilon) [inline, protected]

Read the given parameters, which have been set via simulator commands or configuration file.

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 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 Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P >
void wiselib::LocalizationGpsFreeLcsModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P >::work ( void  )

Check, whether state can be set to finished or not.

Moreover, send initial messages and build local coordinate system.

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