You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
603 B
29 lines
603 B
11 years ago
|
|
||
|
#include <stdio.h>
|
||
11 years ago
|
#include <stdlib.h>
|
||
11 years ago
|
#include <unistd.h>
|
||
|
#include <string.h>
|
||
|
#include <systemlib/mixer/mixer.h>
|
||
|
#include <systemlib/err.h>
|
||
|
#include <drivers/drv_hrt.h>
|
||
|
#include <px4iofirmware/px4io.h>
|
||
|
#include "../../src/systemcmds/tests/tests.h"
|
||
11 years ago
|
#include <geo/geo.h>
|
||
11 years ago
|
|
||
|
int main(int argc, char *argv[]) {
|
||
|
warnx("autodeclination test started");
|
||
|
|
||
|
if (argc < 3)
|
||
|
errx(1, "Need lat/lon!");
|
||
|
|
||
11 years ago
|
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);
|
||
11 years ago
|
|
||
11 years ago
|
}
|