mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-02 05:17:03 +08:00
added ublox specific status and sol flags
This commit is contained in:
@@ -14,6 +14,9 @@ Autoren@ZHAW: schmiemi
|
|||||||
#include "estimator.h"
|
#include "estimator.h"
|
||||||
|
|
||||||
// für das Senden von GPS-Daten an den ArduIMU
|
// 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"
|
#include "subsystems/gps.h"
|
||||||
int32_t GPS_Data[14];
|
int32_t GPS_Data[14];
|
||||||
|
|
||||||
@@ -87,11 +90,11 @@ void ArduIMU_periodicGPS( void ) {
|
|||||||
GPS_Data [6] = gps.gspeed; //ground speed
|
GPS_Data [6] = gps.gspeed; //ground speed
|
||||||
GPS_Data [7] = DegOfRad(gps.course / 1e6); //Kurs
|
GPS_Data [7] = DegOfRad(gps.course / 1e6); //Kurs
|
||||||
//status
|
//status
|
||||||
GPS_Data [8] = gps_mode; //fix
|
GPS_Data [8] = gps.fix; //fix
|
||||||
GPS_Data [9] = gps_status_flags; //flags
|
GPS_Data [9] = gps_ubx.status_flags; //flags
|
||||||
//sol
|
//sol
|
||||||
GPS_Data [10] = gps.fix; //fix
|
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 [12] = -gps.ned_vel.z;
|
||||||
GPS_Data [13] = gps.num_sv;
|
GPS_Data [13] = gps.num_sv;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ Autoren@ZHAW: schmiemi
|
|||||||
#include "estimator.h"
|
#include "estimator.h"
|
||||||
|
|
||||||
// GPS data for ArduIMU
|
// 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
|
// Command vector for thrust
|
||||||
#include "generated/airframe.h"
|
#include "generated/airframe.h"
|
||||||
@@ -90,11 +93,11 @@ void ArduIMU_periodicGPS( void ) {
|
|||||||
high_accel_flag = FALSE;
|
high_accel_flag = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
FillBufWith32bit(ardu_gps_trans.buf, 0, (int32_t)gps_speed_3d); // speed 3D
|
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, 4, (int32_t)gps.gspeed); // ground speed
|
||||||
FillBufWith32bit(ardu_gps_trans.buf, 8, (int32_t)gps_course); // course
|
FillBufWith32bit(ardu_gps_trans.buf, 8, (int32_t)DegOfRad(gps.course / 1e6)); // course
|
||||||
ardu_gps_trans.buf[12] = gps_mode; // status gps fix
|
ardu_gps_trans.buf[12] = gps.fix; // status gps fix
|
||||||
ardu_gps_trans.buf[13] = gps_status_flags; // status flags
|
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)
|
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);
|
I2CTransmit(ARDUIMU_I2C_DEV, ardu_gps_trans, ArduIMU_SLAVE_ADDR, 15);
|
||||||
|
|
||||||
|
|||||||
@@ -179,6 +179,11 @@ void gps_ubx_read_message(void) {
|
|||||||
gps.svinfos[i].azim = UBX_NAV_SVINFO_Azim(gps_ubx.msg_buf, i);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ struct GpsUbx {
|
|||||||
uint8_t send_ck_a, send_ck_b;
|
uint8_t send_ck_a, send_ck_b;
|
||||||
uint8_t error_cnt;
|
uint8_t error_cnt;
|
||||||
uint8_t error_last;
|
uint8_t error_last;
|
||||||
|
|
||||||
|
uint8_t status_flags;
|
||||||
|
uint8_t sol_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct GpsUbx gps_ubx;
|
extern struct GpsUbx gps_ubx;
|
||||||
|
|||||||
Reference in New Issue
Block a user