Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
imu_umarim.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011 Gautier Hattenberger
3  * Derived from Aspirin and ppzuavimu drivers
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  *
22  */
23 
24 #ifndef IMU_UMARIM_H
25 #define IMU_UMARIM_H
26 
27 #include "std.h"
28 #include "generated/airframe.h"
29 #include "subsystems/imu.h"
30 
31 // Default configuration
32 #if !defined IMU_GYRO_P_SIGN & !defined IMU_GYRO_Q_SIGN & !defined IMU_GYRO_R_SIGN
33 #define IMU_GYRO_P_SIGN 1
34 #define IMU_GYRO_Q_SIGN 1
35 #define IMU_GYRO_R_SIGN 1
36 #endif
37 #if !defined IMU_ACCEL_X_SIGN & !defined IMU_ACCEL_Y_SIGN & !defined IMU_ACCEL_Z_SIGN
38 #define IMU_ACCEL_X_SIGN 1
39 #define IMU_ACCEL_Y_SIGN 1
40 #define IMU_ACCEL_Z_SIGN 1
41 #endif
42 
48 #if !defined IMU_GYRO_P_SENS & !defined IMU_GYRO_Q_SENS & !defined IMU_GYRO_R_SENS
49 #define IMU_GYRO_P_SENS 4.973
50 #define IMU_GYRO_P_SENS_NUM 4973
51 #define IMU_GYRO_P_SENS_DEN 1000
52 #define IMU_GYRO_Q_SENS 4.973
53 #define IMU_GYRO_Q_SENS_NUM 4973
54 #define IMU_GYRO_Q_SENS_DEN 1000
55 #define IMU_GYRO_R_SENS 4.973
56 #define IMU_GYRO_R_SENS_NUM 4973
57 #define IMU_GYRO_R_SENS_DEN 1000
58 #endif
59 #if !defined IMU_GYRO_P_NEUTRAL & !defined IMU_GYRO_Q_NEUTRAL & !defined IMU_GYRO_R_NEUTRAL
60 #define IMU_GYRO_P_NEUTRAL 0
61 #define IMU_GYRO_Q_NEUTRAL 0
62 #define IMU_GYRO_R_NEUTRAL 0
63 #endif
64 
65 
77 #if !defined IMU_ACCEL_X_SENS & !defined IMU_ACCEL_Y_SENS & !defined IMU_ACCEL_Z_SENS
78 #define IMU_ACCEL_X_SENS 37.91
79 #define IMU_ACCEL_X_SENS_NUM 3791
80 #define IMU_ACCEL_X_SENS_DEN 100
81 #define IMU_ACCEL_Y_SENS 37.91
82 #define IMU_ACCEL_Y_SENS_NUM 3791
83 #define IMU_ACCEL_Y_SENS_DEN 100
84 #define IMU_ACCEL_Z_SENS 39.24
85 #define IMU_ACCEL_Z_SENS_NUM 39.24
86 #define IMU_ACCEL_Z_SENS_DEN 100
87 #endif
88 #if !defined IMU_ACCEL_X_NEUTRAL & !defined IMU_ACCEL_Y_NEUTRAL & !defined IMU_ACCEL_Z_NEUTRAL
89 #define IMU_ACCEL_X_NEUTRAL 0
90 #define IMU_ACCEL_Y_NEUTRAL 0
91 #define IMU_ACCEL_Z_NEUTRAL 0
92 #endif
93 
94 extern volatile bool_t gyr_valid;
95 extern volatile bool_t acc_valid;
96 
97 /* must be defined in order to be IMU code: declared in imu.h
98 extern void imu_impl_init(void);
99 extern void imu_periodic(void);
100 */
101 
102 #define ImuEvent(_gyro_handler, _accel_handler, _mag_handler) { \
103  imu_umarim_event(); \
104  if (gyr_valid) { \
105  gyr_valid = FALSE; \
106  _gyro_handler(); \
107  } \
108  if (acc_valid) { \
109  acc_valid = FALSE; \
110  _accel_handler(); \
111  } \
112 }
113 
114 /* Own Extra Functions */
115 extern void imu_umarim_event( void );
116 extern void imu_umarim_downlink_raw( void );
117 
118 #endif // PPZUAVIMU_H
void imu_umarim_downlink_raw(void)
Definition: imu_umarim.c:81
volatile bool_t acc_valid
Definition: imu_navgo.c:56
void imu_umarim_event(void)
Definition: imu_umarim.c:88
volatile bool_t gyr_valid
Definition: imu_navgo.c:55
Inertial Measurement Unit interface.