'GPS Navigation, how to select GEO reference as the origin of my map (0, 0)

I'm doing GPS navigation for a vehicle. After getting the GNSS (GPS) data, I need to convert (longitude, latitude) to my map frame. How should I choose the origin of the map?

For example, should I always choose my office as the origin? Or should I update the origin from time to time so that my (x, y) values are not too large?



Solution 1:[1]

Most application store the position as absolute latitude, longitude (often as 4 byte integer, sometimes as 8 byte double). Such apps have no need for referencing related to a map origin.

However the most advanced application, like used in professional navigation devices, store their (-vector) maps in a geo spatial index, usually a quad tree works well.

The street coordinates within such a quad cell, are stored relative to the quad cell origin. This, as you correctly mentioned in your question, delivers much smaller storage space. But that all is related to the coordinates of the streets vertices within the road map.

To store the trajectory of the driven path of the vehicle, you better store them as absolute values (lat, lon).

Solution 2:[2]

Your map frame is totally independent(at the start) of any global frame such as GPS. Much like an Odom frame it is relative to where you start. Because of this you shouldn't "choose" an origin for the map frame, it will always be 0,0. More so, the origin of the map frame should not be updated periodically. Not only will this not be useful, it actually doesn't make sense and will cause other issues.

To get a better idea, you should read a more comprehensive guide in how to use ROS transforms.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AlexWien
Solution 2 BTables