Rev 2099 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2099 | Rev 2141 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | #define _ATTITUDE_H |
6 | #define _ATTITUDE_H |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | #include <inttypes.h> |
8 | #include <inttypes.h> |
- | 9 | ||
Line 9... | Line 10... | ||
9 | 10 | #include "analog.h" |
|
10 | #include "analog.h" |
11 | #include "timer0.h" |
Line 11... | Line 12... | ||
11 | 12 | ||
Line 19... | Line 20... | ||
19 | //#define ATTITUDE_USE_ACC_SENSORS yes |
20 | //#define ATTITUDE_USE_ACC_SENSORS yes |
Line 20... | Line 21... | ||
20 | 21 | ||
21 | /* |
22 | /* |
22 | * The frequency at which numerical integration takes place. 488 in original code. |
23 | * The frequency at which numerical integration takes place. 488 in original code. |
23 | */ |
24 | */ |
Line 24... | Line 25... | ||
24 | #define INTEGRATION_FREQUENCY 488 |
25 | #define INTEGRATION_FREQUENCY (uint16_t)(F_MAINLOOP) |
25 | 26 | ||
26 | /* |
27 | /* |
27 | * Constant for deriving an attitude angle from acceleration measurement. |
28 | * Constant for deriving an attitude angle from acceleration measurement. |
Line 60... | Line 61... | ||
60 | * value for the same (small) angle. |
61 | * value for the same (small) angle. |
61 | * The value is about 200. |
62 | * The value is about 200. |
62 | */ |
63 | */ |
63 | //#define GYRO_ACC_FACTOR ((GYRO_DEG_FACTOR_PITCHROLL) / (DEG_ACC_FACTOR)) |
64 | //#define GYRO_ACC_FACTOR ((GYRO_DEG_FACTOR_PITCHROLL) / (DEG_ACC_FACTOR)) |
Line 64... | Line 65... | ||
64 | 65 | ||
65 | #define OVER180 ((int32_t)GYRO_DEG_FACTOR * 180) |
66 | #define OVER180 ((int32_t)(GYRO_DEG_FACTOR * 180.0f)) |
Line 66... | Line 67... | ||
66 | #define OVER360 ((int32_t)GYRO_DEG_FACTOR * 360) |
67 | #define OVER360 ((int32_t)(GYRO_DEG_FACTOR * 360.0f)) |
67 | 68 | ||
68 | /* |
69 | /* |
69 | * Rotation rates |
70 | * Rotation rates |