Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ins_xsens700.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Christophe De Wagter
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
28 #include "ins_module.h"
29 #include "ins_xsens.h"
30 #include "subsystems/ins.h"
31 
32 #include <inttypes.h>
33 
34 #include "generated/airframe.h"
35 
36 #include "mcu_periph/sys_time.h"
38 #include "messages.h"
39 
40 #if USE_GPS_XSENS
41 #if !USE_GPS
42 #error "USE_GPS needs to be 1 to use the Xsens GPS!"
43 #endif
44 #include "subsystems/gps.h"
47 #include "subsystems/navigation/common_nav.h" /* needed for nav_utm_zone0 */
48 bool_t gps_xsens_msg_available;
49 #endif
50 
51 // positions
55 
56 // velocities
60 
61 // body angles
65 
66 // angle rates
70 
71 // accelerations
75 
76 // magnetic
80 
81 #if USE_INS_MODULE
82 float ins_pitch_neutral;
83 float ins_roll_neutral;
84 #endif
85 
86 
88 //
89 // XSens Specific
90 //
91 
93 
94 #define XsensInitCheksum() { send_ck = 0; }
95 #define XsensUpdateChecksum(c) { send_ck += c; }
96 
97 #define XsensSend1(c) { uint8_t i8=c; InsUartSend1(i8); XsensUpdateChecksum(i8); }
98 #define XsensSend1ByAddr(x) { XsensSend1(*x); }
99 #define XsensSend2ByAddr(x) { XsensSend1(*(x+1)); XsensSend1(*x); }
100 #define XsensSend4ByAddr(x) { XsensSend1(*(x+3)); XsensSend1(*(x+2)); XsensSend1(*(x+1)); XsensSend1(*x); }
101 
102 #define XsensHeader(msg_id, len) { \
103  InsUartSend1(XSENS_START); \
104  XsensInitCheksum(); \
105  XsensSend1(XSENS_BID); \
106  XsensSend1(msg_id); \
107  XsensSend1(len); \
108  }
109 #define XsensTrailer() { uint8_t i8=0x100-send_ck; InsUartSend1(i8); }
110 
112 #include "xsens_protocol.h"
113 
114 
115 #define XSENS_MAX_PAYLOAD 254
117 
118 
119 #define UNINIT 0
120 #define GOT_START 1
121 #define GOT_BID 2
122 #define GOT_MID 3
123 #define GOT_LEN 4
124 #define GOT_DATA 5
125 #define GOT_CHECKSUM 6
126 
127 // FIXME Debugging Only
128 #include "mcu_periph/uart.h"
129 #include "messages.h"
131 
132 
139 float xsens_gps_arm_x = 0;
140 float xsens_gps_arm_y = 0;
141 float xsens_gps_arm_z = 0;
142 
143 
151 
156 static uint8_t ck;
158 
161 
162 volatile int xsens_configured = 0;
163 
164 void xsens_init(void);
165 void xsens_periodic(void);
166 
167 void xsens_init(void) {
168 
170  xsens_configured = 30;
171 
173  xsens_time_stamp = 0;
174 
175 }
176 
177 #if USE_INS_MODULE
178 void ins_init(void) {
179  struct UtmCoor_f utm0 = { nav_utm_north0, nav_utm_east0, 0., nav_utm_zone0 };
181  stateSetPositionUtm_f(&utm0);
182 
185 
186  xsens_init();
187 }
188 
189 void ins_periodic(void) {
190  xsens_periodic();
191 }
192 
193 void ins_update_gps(void) {
194  struct UtmCoor_f utm;
195  utm.east = gps.utm_pos.east / 100.;
196  utm.north = gps.utm_pos.north / 100.;
197  utm.zone = nav_utm_zone0;
198  utm.alt = gps.hmsl / 1000.;
199 
200  // set position
201  stateSetPositionUtm_f(&utm);
202 
203  struct NedCoor_f ned_vel = {
204  gps.ned_vel.x / 100.,
205  gps.ned_vel.y / 100.,
206  gps.ned_vel.z / 100.
207  };
208  // set velocity
209  stateSetSpeedNed_f(&ned_vel);
210 }
211 #endif
212 
213 #if USE_GPS_XSENS
214 void gps_impl_init(void) {
215  gps.nb_channels = 0;
216  gps_xsens_msg_available = FALSE;
217 }
218 #endif
219 
221 {
222  uint8_t foo = 0;
223  XsensSend1ByAddr(&c1);
224  XsensSend1ByAddr(&c2);
225  XsensSend1ByAddr(&foo);
226  XsensSend1ByAddr(&freq);
227 }
228 
229 void xsens_periodic(void) {
230  if (xsens_configured > 0)
231  {
232  switch (xsens_configured)
233  {
234  case 25:
235  /* send mode and settings to MT */
236  XSENS_GoToConfig();
237  //XSENS_SetOutputMode(xsens_output_mode);
238  //XSENS_SetOutputSettings(xsens_output_settings);
239  break;
240  case 18:
241  // Give pulses on SyncOut
242  //XSENS_SetSyncOutSettings(0,0x0002);
243  break;
244  case 17:
245 
246  XsensHeader(XSENS_SetOutputConfiguration_ID, 44);
247  xsens_ask_message_rate( 0x10, 0x10, 4); // UTC
248  xsens_ask_message_rate( 0x20, 0x30, 100); // Attitude Euler
249  xsens_ask_message_rate( 0x40, 0x10, 100); // Delta-V
250  xsens_ask_message_rate( 0x80, 0x20, 100); // Rate of turn
251  xsens_ask_message_rate( 0xE0, 0x20, 50); // Status
252  xsens_ask_message_rate( 0x30, 0x10, 50); // Baro Pressure
253  xsens_ask_message_rate( 0x88, 0x40, 1); // NavSol
254  xsens_ask_message_rate( 0x88, 0xA0, 1); // SV Info
255  xsens_ask_message_rate( 0x50, 0x20, 50); // GPS Altitude Ellipsiod
256  xsens_ask_message_rate( 0x50, 0x40, 50); // GPS Position
257  xsens_ask_message_rate( 0xD0, 0x10, 50); // GPS Speed
258  XsensTrailer();
259  break;
260  case 2:
261  //XSENS_ReqLeverArmGps();
262  break;
263 
264  case 6:
265  //XSENS_ReqMagneticDeclination();
266  break;
267 
268  case 13:
269  //#ifdef AHRS_H_X
270  //#pragma message "Sending XSens Magnetic Declination."
271  //xsens_declination = atan2(AHRS_H_Y, AHRS_H_X);
272  //XSENS_SetMagneticDeclination(xsens_declination);
273  //#endif
274  break;
275  case 12:
276 #ifdef GPS_IMU_LEVER_ARM_X
277 #pragma message "Sending XSens GPS Arm."
278  XSENS_SetLeverArmGps(GPS_IMU_LEVER_ARM_X,GPS_IMU_LEVER_ARM_Y,GPS_IMU_LEVER_ARM_Z);
279 #endif
280  break;
281  case 10:
282  {
283  uint8_t baud = 1;
284  XSENS_SetBaudrate(baud);
285  }
286  break;
287 
288  case 1:
289  XSENS_GoToMeasurment();
290  break;
291  default:
292  break;
293  }
295  return;
296  }
297 
298  //RunOnceEvery(100,XSENS_ReqGPSStatus());
299 }
300 
301 #if USE_INS_MODULE
302 #include "state.h"
303 
304 static inline void update_fw_estimator(void) {
305  // Send to Estimator (Control)
306 #if XSENS_BACKWARDS
307  struct FloatEulers att = {
310  -ins_psi + RadOfDeg(180)
311  };
312  struct FloatRates rates = {
313  ins_p,
314  -ins_q,
315  -ins_r
316  };
317 #else
318  struct FloatEulers att = {
321  -ins_psi
322  };
323  struct FloatRates rates = {
324  -ins_p,
325  ins_q,
326  -ins_r
327  };
328 #endif
330  stateSetBodyRates_f(&rates);
331 }
332 #endif /* USE_INS_MODULE */
333 
334 void handle_ins_msg( void) {
335 
336 #if USE_INS_MODULE
337  update_fw_estimator();
338 #endif
339 
340 #if USE_GPS_XSENS
341  // Horizontal speed
342  float fspeed = sqrt(ins_vx*ins_vx + ins_vy*ins_vy);
343  if (gps.fix != GPS_FIX_3D) {
344  fspeed = 0;
345  }
346  gps.gspeed = fspeed * 100.;
347  gps.speed_3d = (uint16_t)(sqrt(ins_vx*ins_vx + ins_vy*ins_vy + ins_vz*ins_vz) * 100);
348 
349  float fcourse = atan2f((float)ins_vy, (float)ins_vx);
350  gps.course = fcourse * 1e7;
351 #endif // USE_GPS_XSENS
352 }
353 
354 void parse_ins_msg( void ) {
355  uint8_t offset = 0;
356  if (xsens_id == XSENS_ReqLeverArmGpsAck_ID) {
357  xsens_gps_arm_x = XSENS_ReqLeverArmGpsAck_x(xsens_msg_buf);
358  xsens_gps_arm_y = XSENS_ReqLeverArmGpsAck_y(xsens_msg_buf);
359  xsens_gps_arm_z = XSENS_ReqLeverArmGpsAck_z(xsens_msg_buf);
360 
362  }
363  else if (xsens_id == XSENS_Error_ID) {
364  xsens_errorcode = XSENS_Error_errorcode(xsens_msg_buf);
365  }
366  else if (xsens_id == XSENS_MTData2_ID) {
367  for (offset=0;offset<xsens_len;) {
368  uint8_t code1 = xsens_msg_buf[offset];
369  uint8_t code2 = xsens_msg_buf[offset+1];
370  int subpacklen = (int)xsens_msg_buf[offset+2];
371  offset += 3;
372 
373 
374  if (code1 == 0x10)
375  {
376  if (code2 == 0x10)
377  {
378  // UTC
379  }
380  else if (code2 == 0x20)
381  {
382  // Packet Counter
383  }
384  if (code2 == 0x30)
385  {
386  // ITOW
387  }
388  }
389  else if (code1 == 0x20)
390  {
391  if (code2 == 0x30)
392  {
393  // Attitude Euler
394  ins_phi = XSENS_DATA_Euler_roll(xsens_msg_buf,offset) * M_PI / 180;
395  ins_theta = XSENS_DATA_Euler_pitch(xsens_msg_buf,offset) * M_PI / 180;
396  ins_psi = XSENS_DATA_Euler_yaw(xsens_msg_buf,offset) * M_PI / 180;
397 
398  new_ins_attitude = 1;
399 
400  }
401  }
402  else if (code1 == 0x40)
403  {
404  if (code2 == 0x10)
405  {
406  // Delta-V
407  ins_ax = XSENS_DATA_Acceleration_x(xsens_msg_buf,offset)*100.0f;
408  ins_ay = XSENS_DATA_Acceleration_y(xsens_msg_buf,offset)*100.0f;
409  ins_az = XSENS_DATA_Acceleration_z(xsens_msg_buf,offset)*100.0f;
410  }
411  }
412  else if (code1 == 0x80)
413  {
414  if (code2 == 0x20)
415  {
416  // Rate Of Turn
417  ins_p = XSENS_DATA_RateOfTurn_x(xsens_msg_buf,offset) * M_PI / 180;
418  ins_q = XSENS_DATA_RateOfTurn_y(xsens_msg_buf,offset) * M_PI / 180;
419  ins_r = XSENS_DATA_RateOfTurn_z(xsens_msg_buf,offset) * M_PI / 180;
420  }
421  }
422  else if (code1 == 0x30)
423  {
424  if (code2 == 0x10)
425  {
426  // Baro Pressure
427  }
428  }
429  else if (code1 == 0xE0)
430  {
431  if (code2 == 0x20)
432  {
433  // Status Word
434  xsens_msg_statusword = XSENS_DATA_StatusWord_status(xsens_msg_buf,offset);
435  //gps.tow = xsens_msg_statusword;
436 #if USE_GPS_XSENS
437  if (bit_is_set(xsens_msg_statusword,2) && bit_is_set(xsens_msg_statusword,1))
438  {
439  if (bit_is_set(xsens_msg_statusword,23) && bit_is_set(xsens_msg_statusword,24))
440  gps.fix = GPS_FIX_3D;
441  else
442  gps.fix = GPS_FIX_2D;
443  }
444  else gps.fix = GPS_FIX_NONE;
445 #endif
446  }
447  }
448  else if (code1 == 0x88)
449  {
450  if (code2 == 0x40)
451  {
452  gps.week = XSENS_DATA_GpsSol_week(xsens_msg_buf,offset);
453  gps.num_sv = XSENS_DATA_GpsSol_numSv(xsens_msg_buf,offset);
454  gps.pacc = XSENS_DATA_GpsSol_pAcc(xsens_msg_buf,offset);
455  gps.sacc = XSENS_DATA_GpsSol_sAcc(xsens_msg_buf,offset);
456  gps.pdop = XSENS_DATA_GpsSol_pDop(xsens_msg_buf,offset);
457  }
458  else if (code2 == 0xA0)
459  {
460  // SVINFO
461  gps.tow = XSENS_XDI_GpsSvInfo_iTOW(xsens_msg_buf+offset);
462 
463 #if USE_GPS_XSENS
464  gps.nb_channels = XSENS_XDI_GpsSvInfo_nch(xsens_msg_buf+offset);
465 
468 
469  uint8_t i;
470  // Do not write outside buffer
471  for(i = 0; i < Min(gps.nb_channels, GPS_NB_CHANNELS); i++) {
472  uint8_t ch = XSENS_XDI_GpsSvInfo_chn(xsens_msg_buf+offset,i);
473  if (ch > gps.nb_channels) continue;
474  gps.svinfos[ch].svid = XSENS_XDI_GpsSvInfo_svid(xsens_msg_buf+offset, i);
475  gps.svinfos[ch].flags = XSENS_XDI_GpsSvInfo_bitmask(xsens_msg_buf+offset, i);
476  gps.svinfos[ch].qi = XSENS_XDI_GpsSvInfo_qi(xsens_msg_buf+offset, i);
477  gps.svinfos[ch].cno = XSENS_XDI_GpsSvInfo_cnr(xsens_msg_buf+offset, i);
478  }
479 #endif
480  }
481  }
482  else if (code1 == 0x50)
483  {
484  if (code2 == 0x10)
485  {
486  //gps.hmsl = XSENS_DATA_Altitude_h(xsens_msg_buf,offset)* 1000.0f;
487  }
488  else if (code2 == 0x20)
489  {
490  // Altitude Elipsoid
491  gps.utm_pos.alt = XSENS_DATA_Altitude_h(xsens_msg_buf,offset)* 1000.0f;
492 
493  // Compute geoid (MSL) height
494  float geoid_h;
496  gps.hmsl = gps.utm_pos.alt - (geoid_h * 1000.0f);
497 
498  //gps.tow = geoid_h * 1000.0f; //gps.utm_pos.alt;
499  }
500  else if (code2 == 0x40)
501  {
502  // LatLong
503 #ifdef GPS_LED
504  LED_TOGGLE(GPS_LED);
505 #endif
508  gps.week = 0; // FIXME
509  lla_f.lat = RadOfDeg(XSENS_DATA_LatLon_lat(xsens_msg_buf,offset));
510  lla_f.lon = RadOfDeg(XSENS_DATA_LatLon_lon(xsens_msg_buf,offset));
511 
512  // Set the real UTM zone
513  gps.utm_pos.zone = (DegOfRad(lla_f.lon)+180) / 6 + 1;
514 
516  // convert to utm
518  // copy results of utm conversion
519  gps.utm_pos.east = utm_f.east*100;
520  gps.utm_pos.north = utm_f.north*100;
521 
522  gps_xsens_msg_available = TRUE;
523  }
524  }
525  else if (code1 == 0xD0)
526  {
527  if (code2 == 0x10)
528  {
529  // Velocity
530  ins_vx = ((INS_FORMAT)XSENS_DATA_VelocityXYZ_x(xsens_msg_buf,offset));
531  ins_vy = ((INS_FORMAT)XSENS_DATA_VelocityXYZ_y(xsens_msg_buf,offset));
532  ins_vz = ((INS_FORMAT)XSENS_DATA_VelocityXYZ_z(xsens_msg_buf,offset));
533  gps.ned_vel.x = ins_vx;
534  gps.ned_vel.y = ins_vy;
535  gps.ned_vel.z = ins_vx;
536  }
537  }
538 
539  if (subpacklen < 0)
540  subpacklen = 0;
541  offset += subpacklen;
542  }
543 
544 
545  /*
546 
547  gps.pacc = XSENS_DATA_RAWGPS_hacc(xsens_msg_buf,offset) / 100;
548  gps.sacc = XSENS_DATA_RAWGPS_sacc(xsens_msg_buf,offset) / 100;
549  gps.pdop = 5; // FIXME Not output by XSens
550  */
551 
552  /*
553  */
554 
555 
556  /*
557  ins_mx = XSENS_DATA_Calibrated_magX(xsens_msg_buf,offset);
558  ins_my = XSENS_DATA_Calibrated_magY(xsens_msg_buf,offset);
559  ins_mz = XSENS_DATA_Calibrated_magZ(xsens_msg_buf,offset);
560  */
561 
562 
563  /*
564  xsens_time_stamp = XSENS_DATA_TimeStamp_ts(xsens_msg_buf,offset);
565  #if USE_GPS_XSENS
566  gps.tow = xsens_time_stamp;
567  #endif
568  */
569 
570  }
571 
572 }
573 
574 
576  ck += c;
577  switch (xsens_status) {
578  case UNINIT:
579  if (c != XSENS_START)
580  goto error;
581  xsens_status++;
582  ck = 0;
583  break;
584  case GOT_START:
585  if (c != XSENS_BID)
586  goto error;
587  xsens_status++;
588  break;
589  case GOT_BID:
590  xsens_id = c;
591  xsens_status++;
592  break;
593  case GOT_MID:
594  xsens_len = c;
596  goto error;
597  xsens_msg_idx = 0;
598  xsens_status++;
599  break;
600  case GOT_LEN:
602  xsens_msg_idx++;
603  if (xsens_msg_idx >= xsens_len)
604  xsens_status++;
605  break;
606  case GOT_DATA:
607  if (ck != 0)
608  goto error;
610  goto restart;
611  break;
612  default:
613  break;
614  }
615  return;
616  error:
617  restart:
619  return;
620 }
#define GOT_LEN
Definition: ins_xsens700.c:123
unsigned short uint16_t
Definition: types.h:16
float xsens_gps_arm_z
Definition: ins_xsens700.c:141
uint32_t last_3dfix_ticks
cpu time ticks at last valid 3D fix
Definition: gps.h:85
static void stateSetNedToBodyEulers_f(struct FloatEulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (float).
Definition: state.h:995
struct NedCoor_i ned_vel
speed NED in cm/s
Definition: gps.h:69
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define UNINIT
Definition: ins_xsens700.c:119
int8_t xsens_month
Definition: ins_xsens700.c:149
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
Definition: gps.h:72
#define Min(x, y)
#define XsensTrailer()
Definition: ins_xsens700.c:109
INS_FORMAT ins_phi
Definition: ins_xsens700.c:62
int8_t xsens_hour
Definition: ins_xsens700.c:144
uint8_t xsens_errorcode
Definition: ins_xsens700.c:133
INS_FORMAT ins_psi
Definition: ins_xsens700.c:64
static void xsens_ask_message_rate(uint8_t c1, uint8_t c2, uint8_t freq)
Definition: ins_xsens700.c:220
void ins_update_gps(void)
Update INS state with GPS measurements.
void parse_ins_msg(void)
Definition: ins_xsens700.c:354
uint32_t sacc
speed accuracy in cm/s
Definition: gps.h:74
uint8_t zone
UTM zone number.
angular rates
int8_t xsens_min
Definition: ins_xsens700.c:145
INS_FORMAT ins_y
Definition: ins_xsens700.c:53
INS_FORMAT ins_az
Definition: ins_xsens700.c:74
#define XsensSend1ByAddr(x)
Definition: ins_xsens700.c:98
int8_t xsens_sec
Definition: ins_xsens700.c:146
#define INS_ROLL_NEUTRAL_DEFAULT
uint16_t pdop
position dilution of precision scaled by 100
Definition: gps.h:76
INS_FORMAT ins_mx
Definition: ins_xsens700.c:77
int32_t x
North.
uint8_t nav_utm_zone0
Definition: common_nav.c:44
INS_FORMAT ins_my
Definition: ins_xsens700.c:78
#define XSENS_MAX_PAYLOAD
Includes macros generated from xsens_MTi-G.xml.
Definition: ins_xsens700.c:115
Integrated Navigation System interface.
int32_t hmsl
height above mean sea level in mm
Definition: gps.h:67
float lat
in radians
void ins_init(void)
INS initialization.
Definition: ins_alt_float.c:76
void gps_impl_init(void)
Definition: gps_ardrone2.c:38
int8_t xsens_day
Definition: ins_xsens700.c:150
static uint8_t ck
Definition: ins_xsens700.c:156
uint8_t fix
status of fix
Definition: gps.h:78
#define GPS_FIX_3D
Definition: gps.h:43
euler angles
#define GPS_NB_CHANNELS
Definition: gps_ardrone2.h:33
INS_FORMAT ins_ax
Definition: ins_xsens700.c:72
int16_t week
GPS week.
Definition: gps.h:79
uint8_t qi
quality bitfield (GPS receiver specific)
Definition: gps.h:56
vector in Latitude, Longitude and Altitude
float xsens_gps_arm_x
Definition: ins_xsens700.c:139
#define FALSE
Definition: imu_chimu.h:141
int32_t alt
in millimeters above WGS84 reference ellipsoid
void ins_periodic(void)
INS periodic call.
Definition: ins_ardrone2.c:71
INS_FORMAT ins_r
Definition: ins_xsens700.c:69
static void stateSetPositionUtm_f(struct UtmCoor_f *utm_pos)
Set position from UTM coordinates (float).
Definition: state.h:555
int32_t xsens_nanosec
Definition: ins_xsens700.c:147
Paparazzi floating point math for geodetic calculations.
uint32_t tow
GPS time of week in ms.
Definition: gps.h:80
int32_t z
Down.
uint32_t xsens_msg_statusword
Definition: ins_xsens700.c:134
float xsens_gps_arm_y
Definition: ins_xsens700.c:140
INS_FORMAT ins_vy
Definition: ins_xsens700.c:58
static void stateSetSpeedNed_f(struct NedCoor_f *ned_speed)
Set ground speed in local NED coordinates (float).
Definition: state.h:754
void parse_ins_buffer(uint8_t c)
Definition: ins_xsens700.c:575
static uint8_t xsens_len
Definition: ins_xsens700.c:154
uint8_t zone
UTM zone number.
#define GOT_DATA
Definition: ins_xsens700.c:124
struct LlaCoor_f lla_f
Definition: ins_xsens700.c:159
int32_t nav_utm_north0
Definition: common_nav.c:43
int16_t gspeed
norm of 2d ground speed in cm/s
Definition: gps.h:70
vector in North East Down coordinates Units: meters
volatile int xsens_configured
Definition: ins_xsens700.c:162
static uint8_t xsens_id
Definition: ins_xsens700.c:152
Architecture independent timing functions.
float north
in meters
void xsens_periodic(void)
Definition: ins_xsens700.c:229
#define GPS_FIX_NONE
Definition: gps.h:41
#define GPS_FIX_2D
Definition: gps.h:42
uint32_t xsens_output_settings
Definition: ins_xsens700.c:137
Device independent GPS code (interface)
volatile uint8_t ins_msg_received
Definition: ins_xsens700.c:92
position in UTM coordinates Units: meters
unsigned long uint32_t
Definition: types.h:18
#define INS_PITCH_NEUTRAL_DEFAULT
INS_FORMAT ins_mz
Definition: ins_xsens700.c:79
signed short int16_t
Definition: types.h:17
static uint16_t c1
Definition: baro_MS5534A.c:198
uint16_t foo
Definition: main_demo5.c:54
INS_FORMAT ins_vx
Definition: ins_xsens700.c:57
int32_t y
East.
int32_t north
in centimeters
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
Definition: sys_time.h:70
INS_FORMAT ins_theta
Definition: ins_xsens700.c:63
#define LED_TOGGLE(i)
Definition: led_hw.h:30
struct UtmCoor_f utm_f
Definition: ins_xsens700.c:160
float ins_pitch_neutral
Definition: ins_arduimu.c:15
struct SVinfo svinfos[GPS_NB_CHANNELS]
holds information from the Space Vehicles (Satellites)
Definition: gps.h:83
INS_FORMAT ins_q
Definition: ins_xsens700.c:68
signed long int32_t
Definition: types.h:19
#define GOT_START
Definition: ins_xsens700.c:120
#define INS_FORMAT
Definition: ins_module.h:35
#define TRUE
Definition: imu_chimu.h:144
INS_FORMAT ins_vz
Definition: ins_xsens700.c:59
#define GOT_MID
Definition: ins_xsens700.c:122
int16_t speed_3d
norm of 3d speed in cm/s
Definition: gps.h:71
int32_t east
in centimeters
uint32_t pacc
position accuracy in cm
Definition: gps.h:73
uint8_t flags
bitfield with GPS receiver specific flags
Definition: gps.h:55
unsigned char uint8_t
Definition: types.h:14
API to get/set the generic vehicle states.
volatile uint8_t new_ins_attitude
void xsens_init(void)
Definition: ins_xsens700.c:167
#define WGS84_ELLIPSOID_TO_GEOID(_Lat, _Lon, _diff)
uint8_t svid
Satellite ID.
Definition: gps.h:54
INS_FORMAT ins_z
Definition: ins_xsens700.c:54
int32_t nav_utm_east0
Definition: common_nav.c:42
static uint8_t xsens_msg_idx
Definition: ins_xsens700.c:155
static uint16_t c2
Definition: baro_MS5534A.c:198
volatile uint32_t nb_sec
full seconds since startup
Definition: sys_time.h:69
#define GOT_BID
Definition: ins_xsens700.c:121
int16_t xsens_year
Definition: ins_xsens700.c:148
static uint8_t xsens_status
Definition: ins_xsens700.c:153
float xsens_declination
Definition: ins_xsens700.c:138
uint32_t last_3dfix_time
cpu time in sec at last valid 3D fix
Definition: gps.h:86
void handle_ins_msg(void)
Definition: ins_xsens700.c:334
struct UtmCoor_i utm_pos
position in UTM (north,east: cm; alt: mm over ellipsoid)
Definition: gps.h:66
uint8_t xsens_msg_buf[XSENS_MAX_PAYLOAD]
Definition: ins_xsens700.c:116
float ins_roll_neutral
Definition: ins_arduimu.c:14
INS_FORMAT ins_x
Definition: ins_xsens700.c:52
float lon
in radians
uint16_t xsens_output_mode
Definition: ins_xsens700.c:136
INS_FORMAT ins_ay
Definition: ins_xsens700.c:73
signed char int8_t
Definition: types.h:15
static void stateSetBodyRates_f(struct FloatRates *body_rate)
Set vehicle body angular rate (float).
Definition: state.h:1062
float east
in meters
uint16_t xsens_time_stamp
Definition: ins_xsens700.c:135
static void stateSetLocalUtmOrigin_f(struct UtmCoor_f *utm_def)
Set the local (flat earth) coordinate frame origin from UTM (float).
Definition: state.h:459
struct GpsState gps
global GPS state
Definition: gps.c:41
INS_FORMAT ins_p
Definition: ins_xsens700.c:67
Device independent INS code.
uint8_t cno
Carrier to Noise Ratio (Signal Strength) in dbHz.
Definition: gps.h:57
#define XsensHeader(msg_id, len)
Definition: ins_xsens700.c:102
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
uint8_t nb_channels
Number of scanned satellites.
Definition: gps.h:82
uint8_t send_ck
Definition: ins_xsens700.c:157
uint8_t num_sv
number of sat in fix
Definition: gps.h:77