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;
354 offset += XSENS_DATA_Status_LENGTH;
358 offset += XSENS_DATA_TimeStamp_LENGTH;
369 offset += XSENS_DATA_UTC_LENGTH;
Common code for AP and FBW telemetry.
static const float offset[]
struct GpsState gps
global GPS state
#define GPS_VALID_VEL_NED_BIT
#define GPS_VALID_POS_LLA_BIT
#define GPS_FIX_NONE
No GPS fix.
#define GPS_VALID_HMSL_BIT
uint8_t valid_fields
bitfield indicating valid fields (GPS_VALID_x_BIT)
#define GPS_FIX_3D
3D GPS fix
#define LLA_BFP_OF_REAL(_o, _i)
static int32_t wgs84_ellipsoid_to_geoid_i(int32_t lat, int32_t lon)
Get WGS84 ellipsoid/geoid separation.
arch independent LED (Light Emitting Diodes) API
float alt
in meters (normally above WGS84 reference ellipsoid)
#define UNINIT
Receiving pprz messages.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
struct XsensParser parser
struct FloatVect3 vel
NED velocity in m/s.
volatile bool new_attitude
void xsens_periodic(void)
volatile int xsens_configured
uint16_t xsens_time_stamp
#define XSENS_OUTPUT_MODE
#define XSENS_OUTPUT_SETTINGS
void parse_xsens_msg(void)
uint32_t xsens_output_settings
uint16_t xsens_output_mode
void parse_xsens_buffer(uint8_t c)
Parser for the Xsens protocol.
uint8_t msg_buf[XSENS_MAX_PAYLOAD]