Rev 2041 | Rev 2049 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2041 | Rev 2048 | ||
---|---|---|---|
Line 77... | Line 77... | ||
77 | * value for the same (small) angle. |
77 | * value for the same (small) angle. |
78 | * The value is about 200. |
78 | * The value is about 200. |
79 | */ |
79 | */ |
80 | #define GYRO_ACC_FACTOR ((GYRO_DEG_FACTOR_PITCHROLL) / (DEG_ACC_FACTOR)) |
80 | #define GYRO_ACC_FACTOR ((GYRO_DEG_FACTOR_PITCHROLL) / (DEG_ACC_FACTOR)) |
Line -... | Line 81... | ||
- | 81 | ||
- | 82 | #define PITCHROLLOVER180 (GYRO_DEG_FACTOR_PITCHROLL * 180L) |
|
- | 83 | #define PITCHROLLOVER360 (GYRO_DEG_FACTOR_PITCHROLL * 360L) |
|
- | 84 | #define YAWOVER180 (GYRO_DEG_FACTOR_YAW * 180L) |
|
- | 85 | #define YAWOVER360 (GYRO_DEG_FACTOR_YAW * 360L) |
|
81 | 86 | ||
82 | /* |
87 | /* |
83 | * Rotation rates |
88 | * Rotation rates |
84 | */ |
89 | */ |
85 | extern int16_t rate_PID[2], rate_ATT[2], yawRate; |
90 | extern int16_t rate_PID[2], rate_ATT[2], yawRate; |
Line 86... | Line 91... | ||
86 | extern int16_t differential[2]; |
91 | extern int16_t differential[2]; |
87 | 92 | ||
88 | /* |
93 | /* |
89 | * Attitudes calculated by numerical integration of gyro rates |
94 | * Attitudes calculated by numerical integration of gyro rates |
Line 90... | Line 95... | ||
90 | */ |
95 | */ |
- | 96 | extern int32_t attitude[2]; |
|
- | 97 | ||
Line 91... | Line 98... | ||
91 | extern int32_t angle[2], yawAngleDiff; |
98 | // This is really a flight module thing, but it should be corrected along |
92 | 99 | // when the yaw angle is corrected from the compass, and that happens here. |
|
93 | // extern volatile int32_t ReadingIntegralTop; // calculated in analog.c |
100 | // extern int32_t yawAngleDiff; |
94 | 101 | ||
95 | /* |
- | |
96 | * Compass navigation |
102 | /* |
97 | */ |
- | |
98 | extern int16_t magneticHeading; |
103 | * Compass navigation |
99 | extern int16_t compassCourse; |
- | |
100 | // extern int16_t compassOffCourse; |
- | |
101 | extern uint8_t compassCalState; |
104 | */ |
102 | extern int32_t yawGyroHeading; |
105 | extern int16_t magneticHeading; |
Line 103... | Line 106... | ||
103 | extern int16_t yawGyroHeadingInDeg; |
106 | //extern int16_t headingInDegrees; |
- | 107 | extern int32_t heading; |
|
Line 104... | Line 108... | ||
104 | extern uint8_t updateCompassCourse; |
108 | extern uint16_t ignoreCompassTimer; |
105 | extern uint16_t ignoreCompassTimer; |
109 | extern uint16_t accVector; |
106 | extern uint16_t accVector; |
110 | |
107 | 111 | extern int32_t targetHeading; |
|
Line 141... | Line 145... | ||
141 | /* |
145 | /* |
142 | * Main routine, called from the flight loop. |
146 | * Main routine, called from the flight loop. |
143 | */ |
147 | */ |
144 | void calculateFlightAttitude(void); |
148 | void calculateFlightAttitude(void); |
Line -... | Line 149... | ||
- | 149 | ||
- | 150 | void attitude_resetHeadingToMagnetic(void); |
|
145 | 151 |