MAV'RIC
imu_default_config.h
1 /*******************************************************************************
2  * Copyright (c) 2009-2014, MAV'RIC Development Team
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  ******************************************************************************/
31 
32 /*******************************************************************************
33  * \file imu_default_config.h
34  *
35  * \author MAV'RIC Team
36  * \author Gregoire Heitz
37  *
38  * \brief Default configuration for the imu
39  * This can be used to init the imu, if you need to change some values:
40  * copy paste the file content on a new src/file and pass it as 2nd parameter of the imu_init function
41  *
42  ******************************************************************************/
43 
44 
45 #ifndef IMU_DEFAULT_CONFIG_H_
46 #define IMU_DEFAULT_CONFIG_H_
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 #include "imu.h"
53 
54 static imu_conf_t imu_default_config =
55 {
56  .accelerometer =
57  {
58  .axis =
59  {
60  0, //ACC_AXIS_X
61  1, //ACC_AXIS_Y
62  2 //ACC_AXIS_Z
63  },
64  .orientation =
65  {
66  1.0f, //ACC_ORIENTATION_X
67  -1.0f, //ACC_ORIENTATION_Y
68  -1.0f //ACC_ORIENTATION_Z
69  },
70  .bias =
71  {
72  0.0f, //ACC_BIAIS_X
73  64.0f, //ACC_BIAIS_Y
74  90.0f //ACC_BIAIS_Z
75  },
76  .scale_factor =
77  {
78  3924.0f, //RAW_ACC_X_SCALE
79  3844.8f, //RAW_ACC_Y_SCALE
80  4119.6f //RAW_ACC_Z_SCALE
81  }
82  },
83  .gyroscope =
84  {
85  .axis =
86  {
87  0, //GYRO_AXIS_X
88  1, //GYRO_AXIS_Y
89  2 //GYRO_AXIS_Z
90  },
91  .orientation =
92  {
93  1.0f, //GYRO_ORIENTATION_X
94  -1.0f, //GYRO_ORIENTATION_Y
95  -1.0f //GYRO_ORIENTATION_Z
96  },
97  .bias =
98  {
99  0.0f, //GYRO_BIAIS_X
100  0.0f, //GYRO_BIAIS_Y
101  0.0f //GYRO_BIAIS_Z
102  },
103  .scale_factor =
104  {
105  818.5111f, //RAW_GYRO_X_SCALE
106  818.5111f, //RAW_GYRO_Y_SCALE
107  818.5111f //RAW_GYRO_Z_SCALE
108  }
109  },
110  .magnetometer =
111  {
112  .axis =
113  {
114  2, //MAG_AXIS_X
115  0, //MAG_AXIS_Y
116  1 //MAG_AXIS_Z
117  },
118  .orientation =
119  {
120  -1.0f, //MAG_ORIENTATION_X
121  -1.0f, //MAG_ORIENTATION_Y
122  -1.0f //MAG_ORIENTATION_Z
123  },
124  .bias =
125  {
126  42.38f, //MAG_BIAIS_X
127  -107.51f, //MAG_BIAIS_Y
128  2.47f //MAG_BIAIS_Z
129  },
130  .scale_factor =
131  {
132  614.51f, //RAW_MAG_X_SCALE
133  584.28f, //RAW_MAG_Y_SCALE
134  531.95f //RAW_MAG_Z_SCALE
135  }
136  }
137 };
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif // IMU_DEFAULT_CONFIG_H_
uint8_t axis[3]
The axis number (X,Y,Z) referring to the sensor datasheet.
Definition: imu.h:90
The configuration IMU structure.
Definition: imu.h:97
sensor_config_t accelerometer
The gyroscope configuration structure.
Definition: imu.h:99