From 6f572637de44b364ff0bec3f3947fb73de74e88b Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Fri, 30 Nov 2012 14:26:03 -0800 Subject: [PATCH] Fixed missing heading for mtkcustom and nmea --- apps/gps/mtk.c | 2 +- apps/gps/nmea_helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/gps/mtk.c b/apps/gps/mtk.c index 7ba4f52b0a..3b0ee45657 100644 --- a/apps/gps/mtk.c +++ b/apps/gps/mtk.c @@ -128,7 +128,7 @@ int mtk_parse(uint8_t b, char *gps_rx_buffer) mtk_gps->eph = packet->hdop; mtk_gps->epv = 65535; //unknown in mtk custom mode mtk_gps->vel = packet->ground_speed; - mtk_gps->cog = 65535; //unknown in mtk custom mode + mtk_gps->cog = (uint16_t)packet->heading; //mtk: degrees *1e2, mavlink/ubx: degrees *1e2 mtk_gps->satellites_visible = packet->satellites; /* convert time and date information to unix timestamp */ diff --git a/apps/gps/nmea_helper.c b/apps/gps/nmea_helper.c index 577a3a01cc..1a50371c11 100644 --- a/apps/gps/nmea_helper.c +++ b/apps/gps/nmea_helper.c @@ -214,7 +214,7 @@ void *nmea_loop(void *args) nmea_gps->eph = (uint16_t)(info->HDOP * 100); //TODO:test scaling nmea_gps->epv = (uint16_t)(info->VDOP * 100); //TODO:test scaling nmea_gps->vel = (uint16_t)(info->speed * 1000 / 36); //*1000/3600*100 - nmea_gps->cog = 65535; + nmea_gps->cog = (uint16_t)info->direction*100; //nmea: degrees float, ubx/mavlink: degrees*1e2 nmea_gps->satellites_visible = (uint8_t)info->satinfo.inview; int i = 0;