diff options
| author | Keith Packard <keithp@keithp.com> | 2009-06-29 23:03:58 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-06-29 23:03:58 -0700 |
| commit | 527d7c803ed9597b210634018cb2eb9d048d9846 (patch) | |
| tree | f409b8ebe8a74e3736dd7abf76ba401133eafec5 /aoview | |
| parent | ee4919dd771b00e2a2dd1083c9528efa7baab50f (diff) | |
Add GPS speed and error data to telemetry and aoview
Having switched to the SiRF binary GPS format, the velocity and error data
can now be displayed.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'aoview')
| -rw-r--r-- | aoview/aoview.h | 16 | ||||
| -rw-r--r-- | aoview/aoview_monitor.c | 15 | ||||
| -rw-r--r-- | aoview/aoview_state.c | 7 |
3 files changed, 35 insertions, 3 deletions
diff --git a/aoview/aoview.h b/aoview/aoview.h index 4eb4cd80..6fb5e098 100644 --- a/aoview/aoview.h +++ b/aoview/aoview.h @@ -20,6 +20,10 @@ #define _GNU_SOURCE +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -70,9 +74,15 @@ struct aostate { int minute; int second; } gps_time; - double lat; - double lon; - int alt; + double lat; /* degrees (+N -S) */ + double lon; /* degrees (+E -W) */ + int alt; /* m */ + double ground_speed; /* m/s */ + int course; /* degrees */ + double climb_rate; /* m/s */ + double hdop; /* unitless? */ + int h_error; /* m */ + int v_error; /* m */ }; void diff --git a/aoview/aoview_monitor.c b/aoview/aoview_monitor.c index e2ba75ba..d01ca771 100644 --- a/aoview/aoview_monitor.c +++ b/aoview/aoview_monitor.c @@ -117,6 +117,21 @@ aoview_monitor_parse(char *line) state.lat = state.lon = 0; state.alt = 0; } + if (nword >= 46) { + sscanf(words[40], "%lfm/s", &state.ground_speed); + sscanf(words[41], "%d", &state.course); + sscanf(words[42], "%lfm/s", &state.climb_rate); + sscanf(words[43], "%lf", &state.hdop); + sscanf(words[44], "%d", &state.h_error); + sscanf(words[45], "%d", &state.v_error); + } else { + state.ground_speed = 0; + state.course = 0; + state.climb_rate = 0; + state.hdop = 0; + state.h_error = 0; + state.v_error = 0; + } aoview_state_notify(&state); } diff --git a/aoview/aoview_state.c b/aoview/aoview_state.c index 356828c6..52f581ff 100644 --- a/aoview/aoview_state.c +++ b/aoview/aoview_state.c @@ -151,6 +151,13 @@ aoview_state_notify(struct aostate *state) state->gps_time.hour, state->gps_time.minute, state->gps_time.second); + aoview_table_add_row("GPS ground speed", "%fm/s %d°", + state->ground_speed, + state->course); + aoview_table_add_row("GPS climb rate", "%fm/s", + state->climb_rate); + aoview_table_add_row("GPS precision", "%f(hdop) %dm(h) %dm(v)\n", + state->hdop, state->h_error, state->v_error); aoview_great_circle(pad_lat, pad_lon, state->lat, state->lon, &dist, &bearing); aoview_table_add_row("Distance from pad", "%gm", dist * 1000); |
