29 #include "generated/airframe.h"
38 #include "pprzlink/messages.h"
63 #ifndef XSENS_OUTPUT_MODE
64 #define XSENS_OUTPUT_MODE 0x1836
92 #ifndef XSENS_OUTPUT_SETTINGS
93 #define XSENS_OUTPUT_SETTINGS 0x80000C05
137 XSENS_SetSyncOutSettings(0, 0x0002);
141 XSENS_SetSyncOutSettings(1, 100);
144 XSENS_ReqLeverArmGps();
148 XSENS_ReqMagneticDeclination();
153 #pragma message "Sending XSens Magnetic Declination."
159 #ifdef GPS_IMU_LEVER_ARM_X
160 #pragma message "Sending XSens GPS Arm."
161 XSENS_SetLeverArmGps(GPS_IMU_LEVER_ARM_X, GPS_IMU_LEVER_ARM_Y, GPS_IMU_LEVER_ARM_Z);
166 XSENS_SetBaudrate(baud);
171 XSENS_GoToMeasurment();
181 RunOnceEvery(100, XSENS_ReqGPSStatus());
188 if (
xsens_id == XSENS_ReqOutputModeAck_ID) {
190 }
else if (
xsens_id == XSENS_ReqOutputSettings_ID) {
192 }
else if (
xsens_id == XSENS_ReqMagneticDeclinationAck_ID) {
197 }
else if (
xsens_id == XSENS_ReqLeverArmGpsAck_ID) {
204 }
else if (
xsens_id == XSENS_Error_ID) {
208 else if (
xsens_id == XSENS_GPSStatus_ID) {
210 xsens.gps.num_sv = 0;
216 if (ch >
xsens.gps.nb_channels) {
continue; }
221 if (
xsens.gps.svinfos[ch].flags > 0) {
227 else if (
xsens_id == XSENS_MTData_ID) {
236 offset += XSENS_DATA_RAWInertial_LENGTH;
239 #if USE_GPS_XSENS_RAW_DATA && USE_GPS_XSENS
262 offset += XSENS_DATA_RAWGPS_LENGTH;
266 offset += XSENS_DATA_Temp_LENGTH;
291 offset += l * XSENS_DATA_Calibrated_LENGTH / 3;
300 offset += XSENS_DATA_Quaternion_LENGTH;
306 offset += XSENS_DATA_Euler_LENGTH;
309 offset += XSENS_DATA_Matrix_LENGTH;
321 offset += l * XSENS_DATA_Auxiliary_LENGTH / 2;
327 offset += XSENS_DATA_Position_LENGTH;
329 #if (! USE_GPS_XSENS_RAW_DATA) && USE_GPS_XSENS
339 offset += XSENS_DATA_Velocity_LENGTH;
354 #endif // USE_GPS_XSENS
355 offset += XSENS_DATA_Status_LENGTH;
359 offset += XSENS_DATA_TimeStamp_LENGTH;
370 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.
uint8_t xsens_msg_buf[XSENS_MAX_PAYLOAD]
#define GPS_VALID_HMSL_BIT
#define XSENS_OUTPUT_MODE
void xsens_periodic(void)
Parser for the Xsens protocol.
float alt
in meters (normally above WGS84 reference ellipsoid)
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
Parser for the Xsens protocol.
uint8_t xsens_id
Includes macros generated from xsens_MTi-G.xml.
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