28 #include "generated/airframe.h"
37 #include "pprzlink/messages.h"
62 #ifndef XSENS_OUTPUT_MODE
63 #define XSENS_OUTPUT_MODE 0x1836
91 #ifndef XSENS_OUTPUT_SETTINGS
92 #define XSENS_OUTPUT_SETTINGS 0x80000C05
136 XSENS_SetSyncOutSettings(0, 0x0002);
140 XSENS_SetSyncOutSettings(1, 100);
143 XSENS_ReqLeverArmGps();
147 XSENS_ReqMagneticDeclination();
152 #pragma message "Sending XSens Magnetic Declination."
158 #ifdef GPS_IMU_LEVER_ARM_X
159 #pragma message "Sending XSens GPS Arm."
160 XSENS_SetLeverArmGps(GPS_IMU_LEVER_ARM_X, GPS_IMU_LEVER_ARM_Y, GPS_IMU_LEVER_ARM_Z);
165 XSENS_SetBaudrate(baud);
170 XSENS_GoToMeasurment();
180 RunOnceEvery(100, XSENS_ReqGPSStatus());
191 }
else if (
xsens.
parser.
id == XSENS_ReqMagneticDeclinationAck_ID) {
209 xsens.gps.num_sv = 0;
215 if (ch >
xsens.gps.nb_channels) {
continue; }
220 if (
xsens.gps.svinfos[ch].flags > 0) {
235 offset += XSENS_DATA_RAWInertial_LENGTH;
238 #if USE_GPS_XSENS_RAW_DATA && USE_GPS_XSENS
261 offset += XSENS_DATA_RAWGPS_LENGTH;
265 offset += XSENS_DATA_Temp_LENGTH;
290 offset += l * XSENS_DATA_Calibrated_LENGTH / 3;
299 offset += XSENS_DATA_Quaternion_LENGTH;
305 offset += XSENS_DATA_Euler_LENGTH;
308 offset += XSENS_DATA_Matrix_LENGTH;
320 offset += l * XSENS_DATA_Auxiliary_LENGTH / 2;
326 offset += XSENS_DATA_Position_LENGTH;
328 #if (! USE_GPS_XSENS_RAW_DATA) && USE_GPS_XSENS
338 offset += XSENS_DATA_Velocity_LENGTH;
353 #endif // USE_GPS_XSENS
354 offset += XSENS_DATA_Status_LENGTH;
358 offset += XSENS_DATA_TimeStamp_LENGTH;
369 offset += XSENS_DATA_UTC_LENGTH;
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
uint32_t xsens_output_settings
#define GPS_VALID_VEL_NED_BIT
uint8_t valid_fields
bitfield indicating valid fields (GPS_VALID_x_BIT)
#define XSENS_OUTPUT_SETTINGS
uint16_t xsens_output_mode
void parse_xsens_msg(void)
#define GPS_FIX_3D
3D GPS fix
struct FloatVect3 vel
NED velocity in m/s.
static const float offset[]
#define GPS_FIX_NONE
No GPS fix.
#define GPS_VALID_HMSL_BIT
#define XSENS_OUTPUT_MODE
void xsens_periodic(void)
struct XsensParser parser
Parser for the Xsens protocol.
float alt
in meters (normally above WGS84 reference ellipsoid)
uint8_t msg_buf[XSENS_MAX_PAYLOAD]
volatile int xsens_configured
#define LLA_BFP_OF_REAL(_o, _i)
Common code for AP and FBW telemetry.
#define GPS_VALID_POS_LLA_BIT
arch independent LED (Light Emitting Diodes) API
void parse_xsens_buffer(uint8_t c)
struct GpsState gps
global GPS state
uint16_t xsens_time_stamp
static int32_t wgs84_ellipsoid_to_geoid_i(int32_t lat, int32_t lon)
Get WGS84 ellipsoid/geoid separation.
#define UNINIT
Receiving pprz messages.
volatile bool new_attitude