Skip to content

Commit

Permalink
Add readHDOP and getAccuracy
Browse files Browse the repository at this point in the history
Added a solution to issue particle-iot#15

Added two functions to get information about the current accuracy of the GPS.
Needed for example to do a Kalman filter of the signal or any other
signal processing.

The calculation of the accuracy is not done in any spectacular way,
just a multiplication of the positional accuracy, but it should at least give
a sense of what the accuracy is.
  • Loading branch information
TechnoX committed Nov 26, 2016
1 parent 7de5515 commit 14c4476
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions firmware/AssetTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ float AssetTracker::readLonDeg(){
return gps.longitudeDegrees;
}

float AssetTracker::readHDOP(){
return gps.HDOP;
}

float AssetTracker::getAccuracy(){
// 1.8 taken from specs at https://learn.adafruit.com/adafruit-ultimate-gps/
return 1.8 * readHDOP();
}

String AssetTracker::readLatLon(){
String latLon = String::format("%f,%f",gps.latitudeDegrees,gps.longitudeDegrees);
return latLon;
Expand Down
5 changes: 4 additions & 1 deletion firmware/AssetTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class AssetTracker {
readLat(void),
readLon(void),
readLatDeg(void),
readLonDeg(void);
readLonDeg(void),
readHDOP(void),
getAccuracy(void);

bool
gpsFix(void);
char
Expand Down

0 comments on commit 14c4476

Please sign in to comment.