added ublox specific status and sol flags

This commit is contained in:
Felix Ruess
2011-04-27 15:50:58 +02:00
parent e036f01fd1
commit 0e15a116ce
4 changed files with 23 additions and 9 deletions
+6 -3
View File
@@ -14,6 +14,9 @@ Autoren@ZHAW: schmiemi
#include "estimator.h"
// für das Senden von GPS-Daten an den ArduIMU
#ifndef UBX
#error "currently only compatible with uBlox GPS modules"
#endif
#include "subsystems/gps.h"
int32_t GPS_Data[14];
@@ -87,11 +90,11 @@ void ArduIMU_periodicGPS( void ) {
GPS_Data [6] = gps.gspeed; //ground speed
GPS_Data [7] = DegOfRad(gps.course / 1e6); //Kurs
//status
GPS_Data [8] = gps_mode; //fix
GPS_Data [9] = gps_status_flags; //flags
GPS_Data [8] = gps.fix; //fix
GPS_Data [9] = gps_ubx.status_flags; //flags
//sol
GPS_Data [10] = gps.fix; //fix
//GPS_Data [11] = gps_sol_flags; //flags
//GPS_Data [11] = gps_ubx.sol_flags; //flags
GPS_Data [12] = -gps.ned_vel.z;
GPS_Data [13] = gps.num_sv;
+9 -6
View File
@@ -14,7 +14,10 @@ Autoren@ZHAW: schmiemi
#include "estimator.h"
// GPS data for ArduIMU
#include "gps.h"
#ifndef UBX
#error "currently only compatible with uBlox GPS modules"
#endif
#include "subsystems/gps.h"
// Command vector for thrust
#include "generated/airframe.h"
@@ -90,11 +93,11 @@ void ArduIMU_periodicGPS( void ) {
high_accel_flag = FALSE;
}
FillBufWith32bit(ardu_gps_trans.buf, 0, (int32_t)gps_speed_3d); // speed 3D
FillBufWith32bit(ardu_gps_trans.buf, 4, (int32_t)gps_gspeed); // ground speed
FillBufWith32bit(ardu_gps_trans.buf, 8, (int32_t)gps_course); // course
ardu_gps_trans.buf[12] = gps_mode; // status gps fix
ardu_gps_trans.buf[13] = gps_status_flags; // status flags
FillBufWith32bit(ardu_gps_trans.buf, 0, (int32_t)gps.speed_3d); // speed 3D
FillBufWith32bit(ardu_gps_trans.buf, 4, (int32_t)gps.gspeed); // ground speed
FillBufWith32bit(ardu_gps_trans.buf, 8, (int32_t)DegOfRad(gps.course / 1e6)); // course
ardu_gps_trans.buf[12] = gps.fix; // status gps fix
ardu_gps_trans.buf[13] = gps_ubx.status_flags; // status flags
ardu_gps_trans.buf[14] = (uint8_t)high_accel_flag; // high acceleration flag (disable accelerometers in the arduimu filter)
I2CTransmit(ARDUIMU_I2C_DEV, ardu_gps_trans, ArduIMU_SLAVE_ADDR, 15);
+5
View File
@@ -179,6 +179,11 @@ void gps_ubx_read_message(void) {
gps.svinfos[i].azim = UBX_NAV_SVINFO_Azim(gps_ubx.msg_buf, i);
}
}
else if (gps_ubx.msg_id == UBX_NAV_STATUS_ID) {
gps.fix = UBX_NAV_STATUS_GPSfix(gps_ubx.msg_buf);
gps_ubx.status_flags = UBX_NAV_STATUS_Flags(gps_ubx.msg_buf);
gps_ubx.sol_flags = UBX_NAV_SOL_Flags(gps_ubx.msg_buf);
}
}
}
+3
View File
@@ -48,6 +48,9 @@ struct GpsUbx {
uint8_t send_ck_a, send_ck_b;
uint8_t error_cnt;
uint8_t error_last;
uint8_t status_flags;
uint8_t sol_flags;
};
extern struct GpsUbx gps_ubx;