GPS - Coordinates - precision problem.

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

GPS - Coordinates - precision problem.

Post by prem111 » Wed May 20, 2020 9:09 pm

Reads coordinates from gps. The problem is the conversion from dms to dd. I achieve precision (lat, lon) type 12.12345 and I would like me to 12.123456. Working on esp32, is it possible?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: GPS - Coordinates - precision problem.

Post by pythoncoder » Thu May 21, 2020 6:26 am

On my reckoning the least significant digit you're seeing corresponds to about 1 meter. Do commercial GPS modules actually provide this level of absolute accuracy?

Assuming they do, there are two possible approaches. I believe it's possible to compile firmware to use double precision floats, so it would happen automatically.

Another option is to use an integer conversion, relying on the fact that Python supports arbitrary precision integers. Compute an integer value of (seconds * a_large_factor). This could be formatted as a float for printing or display.
Peter Hinch
Index to my micropython libraries.

prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

Re: GPS - Coordinates - precision problem.

Post by prem111 » Thu May 21, 2020 6:51 am

Thanks for reply.
Assuming they do, there are two possible approaches. I believe it's possible to compile firmware to use double precision floats, so it would happen automatically.
What are the possibilities ? how can you do that ?

Thanks !!!

Post Reply