PX4/Firmware — pull request #866 by thomasgubler (2014-04-25 13:16:52+00:00)
Title: Single global map projection interface

The goal of this PR is to have only one global instance of the map projection. All apps can call map_projection_project or map_projection_reproject and automatically get a result calculated with the current parameters for the projection. The reference values for the projection are set by the navigator app through map_projection_init when the home position is set for the first time. Later this could be extended to automatically reinitialize the projection on very long distance flights. (We have to think more carefully how to make sure that all position estimators can handle this reference change though.)

By handling the projection globally and only with one instance we can avoid the boiler plate code for handling of the projection in all apps individually. Also, at any point in time, the projection is the same for all apps.

@DrTon: position_estimator_inav seems to have a rather advanced handling of how to update the reference for the projection. I tried to integrate the global interface without changing too much of your code. But maybe we can get rid of a lot of code now there. Also position_estimator_inav waits for 1s before setting the reference. Can you help me with stripping that code down?

**The PR is not ready yet for merging.**

Todo:
* Also include altitude in reference position (even if it is not used in the projection)
* finish transition to global projection handling in position_estimator_inav
* Testing