[ardrone2] Parrot GPS show sattelite information.

closes #474
This commit is contained in:
fvantienen
2013-07-15 19:43:46 +02:00
committed by Felix Ruess
parent e1656db2b9
commit e8ad164cdf
3 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -178,7 +178,7 @@ typedef struct _navdata_gps_t {
uint8_t unk_2[16];
struct{
uint8_t sat;
uint8_t unk;
uint8_t cn0;
}channels[12];
int32_t gps_plugged; /*!< When the gps is plugged */
uint8_t unk_3[108];
@@ -36,6 +36,7 @@ void gps_impl_init( void ) {
}
void gps_ardrone2_parse(navdata_gps_t *navdata_gps) {
int i;
// Set the lla double struct from the navdata
struct LlaCoor_d gps_lla_d;
gps_lla_d.lat = RadOfDeg(navdata_gps->lat);
@@ -51,6 +52,12 @@ void gps_ardrone2_parse(navdata_gps_t *navdata_gps) {
LLA_BFP_OF_REAL(gps.lla_pos, gps_lla_d);
// TODO: parse other stuff
gps.nb_channels = GPS_NB_CHANNELS;
for(i = 0; i < GPS_NB_CHANNELS; i++) {
gps.svinfos[i].svid = navdata_gps->channels[i].sat;
gps.svinfos[i].cno = navdata_gps->channels[i].cn0;
}
// Check if we have a fix TODO: check if 2D or 3D fix?
if (navdata_gps->gps_state == 1)
+1 -1
View File
@@ -30,7 +30,7 @@
#include "boards/ardrone/at_com.h"
//#define GPS_NB_CHANNELS 12 // TODO: Get channels out of packet
#define GPS_NB_CHANNELS 12
extern bool_t gps_ardrone2_available;
/*