From 6418f71d5878be6093100a169c21d83fc5fa8f4d Mon Sep 17 00:00:00 2001 From: Christophe De Wagter Date: Fri, 1 Apr 2011 21:40:19 +0200 Subject: [PATCH] gps_xsens --- .../subsystems/fixedwing/gps_xsens.makefile | 3 +-- sw/airborne/modules/ins/ins_xsens.c | 12 +++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/conf/autopilot/subsystems/fixedwing/gps_xsens.makefile b/conf/autopilot/subsystems/fixedwing/gps_xsens.makefile index a0f6e0f61c..ed0607f397 100644 --- a/conf/autopilot/subsystems/fixedwing/gps_xsens.makefile +++ b/conf/autopilot/subsystems/fixedwing/gps_xsens.makefile @@ -3,6 +3,5 @@ # ap.CFLAGS += -DGPS -ap.srcs += $(SRC_FIXEDWING)/gps_xsens.c $(SRC_FIXEDWING)/gps.c +$(TARGET).srcs += $(SRC_SUBSYSTEMS)/gps.c -sim.srcs += $(SRC_FIXEDWING)/gps.c diff --git a/sw/airborne/modules/ins/ins_xsens.c b/sw/airborne/modules/ins/ins_xsens.c index 8f098f8e2e..ca9854fe7e 100644 --- a/sw/airborne/modules/ins/ins_xsens.c +++ b/sw/airborne/modules/ins/ins_xsens.c @@ -168,6 +168,8 @@ int8_t xsens_day; float xsens_lat; float xsens_lon; +int8_t xsens_gps_nr_channels = 16; + static uint8_t xsens_id; static uint8_t xsens_status; @@ -213,7 +215,7 @@ void handle_ins_msg( void) { EstimatorSetAtt(ins_phi, ((float)gps.course / 1e7), ins_theta); // EstimatorSetAlt(ins_z); estimator_update_state_gps(); - reset_gps_watchdog(); + // reset_gps_watchdog(); } void parse_ins_msg( void ) { @@ -229,12 +231,12 @@ void parse_ins_msg( void ) { } #ifdef USE_GPS_XSENS else if (xsens_id == XSENS_GPSStatus_ID) { - gps_nb_channels = XSENS_GPSStatus_nch(xsens_msg_buf); - gps.num_sv = gps_nb_channels; + xsens_gps_nr_channels = XSENS_GPSStatus_nch(xsens_msg_buf); + gps.num_sv = xsens_gps_nr_channels; uint8_t i; - for(i = 0; i < Min(gps_nb_channels, GPS_NB_CHANNELS); i++) { + for(i = 0; i < Min(xsens_gps_nr_channels, xsens_gps_nr_channels); i++) { uint8_t ch = XSENS_GPSStatus_chn(xsens_msg_buf,i); - if (ch > GPS_NB_CHANNELS) continue; + if (ch > xsens_gps_nr_channels) continue; gps.svinfos[ch].svid = XSENS_GPSStatus_svid(xsens_msg_buf, i); gps.svinfos[ch].flags = XSENS_GPSStatus_bitmask(xsens_msg_buf, i); gps.svinfos[ch].qi = XSENS_GPSStatus_qi(xsens_msg_buf, i);