Rev 1645 | Rev 1805 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1645 | Rev 1775 | ||
---|---|---|---|
Line 79... | Line 79... | ||
79 | #define GYRO_ACC_FACTOR ((GYRO_DEG_FACTOR_PITCHROLL) / (DEG_ACC_FACTOR)) |
79 | #define GYRO_ACC_FACTOR ((GYRO_DEG_FACTOR_PITCHROLL) / (DEG_ACC_FACTOR)) |
Line 80... | Line 80... | ||
80 | 80 | ||
81 | /* |
81 | /* |
82 | * Rotation rates |
82 | * Rotation rates |
83 | */ |
83 | */ |
84 | extern int16_t rate_PID[2], yawRate; |
84 | extern int16_t rate_PID[2], rate_ATT[2], yawRate; |
Line 85... | Line 85... | ||
85 | extern int16_t differential[2]; |
85 | extern int16_t differential[2]; |
86 | 86 | ||
87 | /* |
87 | /* |
88 | * Attitudes calculated by numerical integration of gyro rates |
88 | * Attitudes calculated by numerical integration of gyro rates |
Line 89... | Line 89... | ||
89 | */ |
89 | */ |
Line 90... | Line 90... | ||
90 | extern int32_t angle[2], yawAngle; |
90 | extern int32_t angle[2], yawAngleDiff; |
91 | 91 | ||
Line 101... | Line 101... | ||
101 | extern int32_t yawGyroHeading; |
101 | extern int32_t yawGyroHeading; |
102 | extern int16_t yawGyroHeadingInDeg; |
102 | extern int16_t yawGyroHeadingInDeg; |
103 | extern uint16_t updateCompassCourse; |
103 | extern uint16_t updateCompassCourse; |
104 | extern uint16_t badCompassHeading; |
104 | extern uint16_t badCompassHeading; |
Line -... | Line 105... | ||
- | 105 | ||
- | 106 | void updateCompass(void); |
|
105 | 107 | ||
106 | /* |
108 | /* |
107 | * Interval wrap-over values for attitude integrals |
109 | * Interval wrap-over values for attitude integrals |
108 | */ |
110 | */ |
Line 122... | Line 124... | ||
122 | * - Invent your own... |
124 | * - Invent your own... |
123 | */ |
125 | */ |
124 | extern int16_t dynamicOffset[2], dynamicOffsetYaw; |
126 | extern int16_t dynamicOffset[2], dynamicOffsetYaw; |
Line 125... | Line 127... | ||
125 | 127 | ||
- | 128 | /* |
|
- | 129 | * For NaviCtrl use. |
|
- | 130 | */ |
|
- | 131 | extern int16_t averageAcc[2], averageAccCount; |
|
- | 132 | ||
126 | /* |
133 | /* |
127 | * Re-init flight attitude, setting all angles to 0 (or to whatever can be derived from acc. sensor). |
134 | * Re-init flight attitude, setting all angles to 0 (or to whatever can be derived from acc. sensor). |
128 | * To be called when the pilot commands gyro calibration (eg. by moving the left stick up-left or up-right). |
135 | * To be called when the pilot commands gyro calibration (eg. by moving the left stick up-left or up-right). |
129 | */ |
136 | */ |
Line 133... | Line 140... | ||
133 | * Experiment. |
140 | * Experiment. |
134 | */ |
141 | */ |
135 | // void attitude_startDynamicCalibration(void); |
142 | // void attitude_startDynamicCalibration(void); |
136 | // void attitude_continueDynamicCalibration(void); |
143 | // void attitude_continueDynamicCalibration(void); |
Line -... | Line 144... | ||
- | 144 | ||
- | 145 | int32_t getAngleEstimateFromAcc(uint8_t axis); |
|
137 | 146 | ||
138 | /* |
147 | /* |
139 | * Main routine, called from the flight loop. |
148 | * Main routine, called from the flight loop. |
140 | */ |
149 | */ |
141 | void calculateFlightAttitude(void); |
150 | void calculateFlightAttitude(void); |