Straight to the chase, no BB.
First of all, the interior positioning is strictly divided into 3 steps in terms of architecture:
1, indoor map and indoor map can be related to some of the mature API
2, in any way to obtain the coordinates of indoor positioning
3, the indoor positioning of the coordinates into the indoor map of the API or a compatible with both the conversion mode
(optional) 4, the positioning stability of the filter processing, the location of the coordinate point does not appear jumping point, lag, drop frame, the direction of the North angle error and other processing solutions
At present, the indoor positioning resources in the market is scattered, mainly divided into two types of map suppliers and location providers, but also the integration of indoor positioning resources enterprises, such as a stone technology
So if you want to have research on indoor positioning, you need to know more about the provider's SDK information.
Recently, our company's indoor positioning project was immediately fixed, just empty to write a blog to take a break, summarize the development of iOS stepped on the pit:
1, the mobile phone map appears black colorless model, the web side appears transparent model.
2. Route navigation cannot be planned.
3. Unable to draw path/sdk related method/object does not execute.
4, the Map object is not destroyed after the creation, resulting in the second map object in the planning path of the time of the flash, crash.
5, the map icon appears black block.
6. The dealloc method is not executed after returning to the previous level interface.
7, Path Detour.
8, U-shaped bends or L-shaped bends in the road network adsorption mode will appear jumping points.
9. The map failed to load.
10, map drawing/parsing is slow.
======================== Split Line =========================
My solution:
1, the mobile phone map appears black colorless model, the web side appears transparent model.
Cause: This is due to the incompatibility of the theme, the map in the SDK parsing process according to the resource bundle has been given its color properties, if there is no relevant resource package is default to Black
I am using a hummingbird view, our map properties and display are customized, so using a regular theme will result in the appearance of the black block model.
Web-side JS SDK has done related processing, so the display is only transparent model.
Workaround: Communicate with the relevant developers and re-update a custom theme.
2. Route navigation cannot be planned.
Reason: Because there is no relevant road network can reach the end, the structure of the road network is roughly like this:
The black area is reachable road network, the red is the Forbidden road network. See, if there is no black road near the end, it means that this point is unreachable.
How much is nearby, please note the vendor's API documentation description
Solution: To work with the relevant map suppliers to solve this problem, because the specific points can be reached/unreachable, it is best to go to the field exploration.
3. Unable to draw path/sdk related method/object does not execute.
Reason: Please check with the official engineering configuration of whether there is a discrepancy between the place, I appear this reason is because of other Linker Flags in a-OBJC mistake written-OBJC,
C must be uppercase, or the Xcode compiler does not fully compile the OC file in the framework, but the compilation is really error-free, but once the API is called, the API can cause crashes and other risks.
Solution: Other Linker Flags add-OBJC, case to distinguish
4, the Map object is not destroyed after the creation, resulting in the second map object in the planning path of the time of the flash, crash.
Cause: The previous Map object became a zombie object, and the zombie object was manipulated while planning a route/or other operation, which had a log when it crashed:
"You have manipulated a non-operable object/pointer"
WORKAROUND: Regardless of how the map view object is used, be sure to check whether the Dealloc method is executed when the VC map interface is rolled out (I use the Push method).
If not, it's a good idea to remove all views when you click Exit, including the map view and the associated View object, and then leave the pointer blank to ensure that dealloc is executed.
To ensure that the program is stable, you can do more.
5, the map icon appears black block.
Reason: This is awkward to say. = Because there is a simulation navigation in the requirements, it is necessary to simulate the location of this anchor point moving a little bit on the line, and walking events.
Yes, definitely use Nstimer ah ... So this is because I quit the interface in another logic I didn't think of, causing the timer not to be destroyed and paused.
And then, the map is also OpenGL-drawn. The next time you enter the map interface, the timer takes up a sub-thread, causing OpenGL to never have time to draw the icon
Causes some elements of the map to appear as black blocks.
Resolution: Be sure to count several ways to exit the interface, and then encapsulate a secure method (that is, you can kill the timer without releasing the empty object),
In each case, exit the interface to perform this safe kill timer method, and finally must supervise the implementation of the Dealloc method or not.
6. The Dealloc method is not executed after returning to the previous level interface .
Reason: Before also mentioned many, mainly is the SDK some object and the main controller strong reference causes, this is very common, must develop at any time to view Dealloc's habit.
Some people will think: Now not all arc? Who cares about this?
This is wrong, arc can save a lot of code for developers, use arc no longer need to care about when retain, when release,
But that doesn't mean you can not think about memory management, you may need to ask yourself this question frequently: Who owns this object?
Workaround: Note which strong referenced objects are manipulated, when to set nil, to ensure a lower memory cost, performance is also a significant improvement.
7, Path Detour.
Reason: Because of the sparse road network, resulting in the thought of an end must follow the planning of the road network to go, interested can study the Dijstra algorithm,
This is a solution for most mainstream maps/navigation.
The road network is sparse, only this way:
Road network reasons around the far, not blame you do not blame the SDK, only blame Map road network is not designed well.
Solution: Of course, communicate with suppliers. =.. The program can't do anything ....
8, U-shaped bends or L-shaped bends in the road network adsorption mode will appear jumping points.
Reason: Because the principle of path adsorption is to determine your location in the vicinity of the path about how many meters, the point is forced to adsorption to the path
Encountered U-bend/L-type curve will appear two judgments, and plainly, the two road adsorption range overlap caused by the judgment confusion. Yes, I understand. =
Solution: or communication. Can only let them to the road network planning more dense, reduce the U-shaped curve generation, as for the L type ... Just a little jump.
No one will stare at the phone all the way. Indoor navigation: Lift up the head to know how to go, I jump jump =. =
9. The map failed to load. and 10, map drawing/parsing is slow.
Cause: Because the entire map file is confusing, and the parsing engine is C + + (Hummingbird view), the parsing is finished and then OpenGL is drawn.
Listen to all the cumbersome =. =.. Of course it's slow. and the entire SDK process must be authenticated before you can get resolved permissions. Of course it's slow.
Solution: No way. However, parsing and UI manipulation can be done separately:
We want multiple tasks to be executed at the same time (in multiple lines thread), and after they are all done, then perform other tasks,you can then create a grouping that allows multiple tasks to form a group, and the following code performs subsequent tasks after multiple tasks in the group have been completed:
First parse the map, then the page casually display a hub or toast or a small chrysanthemum and so on. It means we're painting a map of madness ...
Then set two callbacks, a map success and failure:
This bool is the limit judgment when the map is ready to perform the next operation after parsing.
If parsing succeeds, the UI is created and added, etc... If it fails, displays a picture that failed to load.
Note that in the end I have all the actions back to the main thread to execute:
So that you can not die the main thread of the case first launched the interface, while parsing, parsing and then add the map to the view, failed to show the failure of the page is good.
If the analysis (that is, the map construction method) in the Viewdidload, will be stuck in the main thread 1-8 seconds range ... This certainly does not work, the relatively smooth processing first temporarily only this.
The habit of developing annotations is best =. = Maintenance and two development time will be very convenient =. =
Get a piece of me. h file = of a Master inheritance object. =
Being spit slot into the project when the SDK does.
Last =. = Axc Dafa good ....
Summarize some of the pits that have been trampled on iOS indoor positioning development ...