When multiple localization threads run in parallel and compute the pose of the robot with varying degrees of precision, there has to an arbiter to combine these information into one pose. The class ArLocalizationManager is used for this integration. Currently the fusion technique is based on the kalman filter principle. Here each localization reports their belief as a mean pose and a variance matrix which is a measure of the uncertainity of the belief. The mean of the fused distribution is the weighted average of the means. The variance of the fused distribution will be the harmonic mean of the variances.
All localization techniques, as well as ArLocalizationManager itself, implement the ArBaseLocalizationTask interface.
In order to use the localization manager in your own software, follow these two steps, at minimum and in order:
1. Create a ArLocalizationManager class with an instantiated ArRobot, and an ArMap object correspoinding to the robot's environment. For example,
// Create the localization manager (it will start its own thread here) ArLocalizationManager locManager(myRobot, myMap);
2. Add localization tasks to the manager.
// Add the laser localization task to the manager. locManager.addLocalizationTask(&locTask); // Add the GPS localization task to the manager. locManager.addLocalizationTask(&gpsLocTask);
3. Link to the BaseArnl, AriaForArnl and ArNetwarkingForArnl libraries, and each library providing the localization task class used (as well as any other libraries required by a localization library).
For more information about each localization library, see its reference manual.