Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
double rtn = strtod(&msg[inx], null);// convert to pure degrees [dd.dddd] formatdouble degrees;double minutesfrac = modf(rtn/100, °rees);rtn = degrees + (minutesfrac*100)/60;// convert to radiansrtn *= (M_PI/180);return rtn;
Which is significant!! Depending on the accuracy of your GPS in the first place.
So no easy solution!
A floating point co-processor is not that hard to add, if it matters.
Quote from: Soeren on April 07, 2010, 06:24:19 PMA floating point co-processor is not that hard to add, if it matters.I probably missed something, but that wont help with precision, only with processing speed which doesn't seem to be an issue here.Chelmi.
Does any (non-military) GPS come with a better accuracy?All the GPS'es I've had, have been able to suddenly jump 50m or more when stationary and my "fittness-tracker" or whatever the name is sometimes off even more (I've lost every ounze of faith in GPS as a nav tool for 'bots).
I take it back Webbot, maybe it would be a good thing if your lib passes coordinates in degrees, because right now i can't avoid the rounding problem from the first conversion to radians done in the lib. Then I can see if i can convert all my calculations to use degrees instead of radians, or come up with a better solution.
Correct - as hardware floating point units are still normally 32 bit.
Yep there are some. For example these that are used in sports cars at a price but claim 2cm accuracy!http://www.racelogic.co.uk/?show=VBOX-Products-VBOX_III_RTK&gclid=CLWD_pHx9aACFSMslAod6zTesw
Webbot, any chance you can add a feature or two to the nmea.h lib? Did you ever see if what you parse from the NMEA string and save as double (before radian conversion ) equal each other, or do you see the same drift I do? Maybe can you provide two strings in the NMEA struct that is the raw lat/lon ASCII tokens?
EDIT:- I've done some playing around and found a way of converting 'degrees and minutes' into 'degrees' with less rounding. @madsci - Are you able to build the lib from scratch? If so then I can show you what lines to change.
Just found thishttp://floating-point-gui.de/have yet to read it, but hopefully it has some answers for this rounding issue.