aboutsummaryrefslogtreecommitdiff
path: root/Tools/tests-host/autodeclination_test.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-04-28 20:42:46 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-04-28 20:42:46 +0200
commit9c81ab113e73c8862cc3f4e81411cb69dbec14ee (patch)
tree2d206642393ab26520a1eb3f626c0bc5d859b3fa /Tools/tests-host/autodeclination_test.cpp
parent7aefcb7a09a12fae2dcbe2bc2360948aefbb66a4 (diff)
downloadpx4-firmware-9c81ab113e73c8862cc3f4e81411cb69dbec14ee.tar.gz
px4-firmware-9c81ab113e73c8862cc3f4e81411cb69dbec14ee.tar.bz2
px4-firmware-9c81ab113e73c8862cc3f4e81411cb69dbec14ee.zip
Updated outo-test
Diffstat (limited to 'Tools/tests-host/autodeclination_test.cpp')
-rw-r--r--Tools/tests-host/autodeclination_test.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/Tools/tests-host/autodeclination_test.cpp b/Tools/tests-host/autodeclination_test.cpp
index b1b30f5d9..6c751dc1e 100644
--- a/Tools/tests-host/autodeclination_test.cpp
+++ b/Tools/tests-host/autodeclination_test.cpp
@@ -1,5 +1,6 @@
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <systemlib/mixer/mixer.h>
@@ -7,6 +8,7 @@
#include <drivers/drv_hrt.h>
#include <px4iofirmware/px4io.h>
#include "../../src/systemcmds/tests/tests.h"
+#include <geo/geo.h>
int main(int argc, char *argv[]) {
warnx("autodeclination test started");
@@ -14,6 +16,13 @@ int main(int argc, char *argv[]) {
if (argc < 3)
errx(1, "Need lat/lon!");
-
+ char* p_end;
+
+ float lat = strtod(argv[1], &p_end);
+ float lon = strtod(argv[2], &p_end);
+
+ float declination = get_mag_declination(lat, lon);
+
+ printf("lat: %f lon: %f, dec: %f\n", lat, lon, declination);
} \ No newline at end of file