mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 13:55:40 +08:00
@@ -178,7 +178,7 @@ typedef struct _navdata_gps_t {
|
|||||||
uint8_t unk_2[16];
|
uint8_t unk_2[16];
|
||||||
struct{
|
struct{
|
||||||
uint8_t sat;
|
uint8_t sat;
|
||||||
uint8_t unk;
|
uint8_t cn0;
|
||||||
}channels[12];
|
}channels[12];
|
||||||
int32_t gps_plugged; /*!< When the gps is plugged */
|
int32_t gps_plugged; /*!< When the gps is plugged */
|
||||||
uint8_t unk_3[108];
|
uint8_t unk_3[108];
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ void gps_impl_init( void ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void gps_ardrone2_parse(navdata_gps_t *navdata_gps) {
|
void gps_ardrone2_parse(navdata_gps_t *navdata_gps) {
|
||||||
|
int i;
|
||||||
// Set the lla double struct from the navdata
|
// Set the lla double struct from the navdata
|
||||||
struct LlaCoor_d gps_lla_d;
|
struct LlaCoor_d gps_lla_d;
|
||||||
gps_lla_d.lat = RadOfDeg(navdata_gps->lat);
|
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);
|
LLA_BFP_OF_REAL(gps.lla_pos, gps_lla_d);
|
||||||
|
|
||||||
// TODO: parse other stuff
|
// 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?
|
// Check if we have a fix TODO: check if 2D or 3D fix?
|
||||||
if (navdata_gps->gps_state == 1)
|
if (navdata_gps->gps_state == 1)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "boards/ardrone/at_com.h"
|
#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;
|
extern bool_t gps_ardrone2_available;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user