Diplomarbeit 
Indoor Localization of Mobile Devices Based on Wi-Fi Signals Using Raytracing Supported Algorithms
Entstehung
Einzelbild herunterladen
 
  

70 5. Implementationlection of functions that are used to generate the HTML code with Python stringprocessing capabilities. Further development on the framework will probably inducethe need for a higher level templating engine.5.2.2 Localization AlgorithmsEach localization algorithms in the presented framework is implemented as a Pythonclass derived from theLocalizer()class. TheLocalizer()class is responsible forhandling the general interactions with the framework, whereas the subclasses imple-ment algorithmic specific code that has a low computational footprint. The imple-mentation of the computational expensive parts is relayed to the Cython languagefor each of the three algorithms.EnvironmentThe information about the scene specific details needed for the application of thelocalization algorithms is stored in theEnvironment()class which is therefore avail-able as a private member to theLocalizer()derived implementations. TheEnvi-ronment()class is initialized by a list of AP definitions which will lead to loadingthe corresponding stored PHOTON output files. The 3D voxel data of PHOTONis stored in.raw files which compose of a simple concatenation offloat32values,representing RSSI values, that are loaded into a 3D ndarray with NumPy-nativefunctions.Furthermore, the scene geometry, represented by a.obj file, will also be loaded bythe Evaluator. An initialized Environment hold thus the two primary datastructuresthat are used for deriving the location conditional probabilities. The scene geometrytriangle mesh is used for generating the ndarrays for the transition probabilities.And the PHOTON output is used for computing the ndarrays for the emissionprobabilities.HMMThe HMM based algorithm is implemented in theHMMLocalizer()Python classin conjunction with theViterbiDecoder()Cython class. On initialization, theHMMLocalizer()loads the cached or refreshes the needed emission probabilities bydelegating the PHOTON data stored at theEnvironment()to the Cython func-tionbuildStatesWithEmissionProbs(). The returned ndarrayemission_probsis stored at classlevel.The ndarraytransition_probsfor the transition probabilities is also generated inthis step. At first, the triangle mesh of the scene is voxelized by Cython acceleratedfunctions. On the voxelized representation of the geometry, the transition probabil-ities can be efficiently computed by the Cython functionbuildTransitionProbs.TheViterbiDecoder()class is initialized with both ndarrays for the probabilitiesand can be used from theHMMLocalizer()for the decoding of a sequence of RSSImeasurements. The basic flow of the input in form of RSSI reading is given by the