2011-05-31 02:10 AM
Hi all,
In my project, I am using a GPS to measure some distances, and some angles combined with a magnetometer. Therefore, I have to do a lot of floating point operations. It's dirty, it's slow, and it's taking a lot of memory. Does anybody has already used any fixed point library ? Can't find anything ''usefull'' with google, I wonder why ... :\ Thanks for help. Best regards, VDM.2011-05-31 04:30 AM
''Can't find anything ''usefull'' with google''
Have you tried - it's specifically for finding open-source code...
2011-05-31 07:51 AM
I found this :
2011-05-31 08:11 AM
It even has test results for an STM32!
:)2011-05-31 03:03 PM
There also code Ivan Mellen has provided. Including a quite slick square root function.
http://www.embeddedsignals.com/ Fixed point (16:16, or whatever) is pretty basic stuff. You do however need to be careful about the precision you want, and keeping the numbers, or intermediates, in range. Even if you use someone else's library, you'd better have a very clear idea of the math, and test it throughly. At least floating point is relatively elastic. It's certainly possible to handle some GPS stuff in integer math, especially if you have units like centimeters, and are doing relative measurements. The geoid/squashed ellipsoid representation of latitude/longitude might be a lot of fun though.