Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2102 → Rev 2103

/branches/dongfang_FC_fixedwing/attitude.c
28,12 → 28,7
* The variables are overwritten at each attitude calculation invocation - the values
* are not preserved or reused.
*/
int16_t rate_ATT[3];
 
// With different (less) filtering
int16_t rate_PID[3];
int16_t differential[3];
 
/*
* Gyro integrals. These are the rotation angles of the airframe compared to the
* horizontal plane, yaw relative to yaw at start.
86,13 → 81,8
*************************************************************************/
void getAnalogData(void) {
uint8_t axis;
 
analog_update();
 
for (axis = PITCH; axis <= YAW; axis++) {
rate_PID[axis] = gyro_PID[axis];
rate_ATT[axis] = gyro_ATT[axis];
differential[axis] = gyroD[axis];
}
}
 
110,7 → 100,7
*/
 
for (axis = PITCH; axis <= YAW; axis++) {
attitude[axis] += rate_ATT[axis];
attitude[axis] += gyro_ATT[axis];
if (attitude[axis] > OVER180) {
attitude[axis] -= OVER360;
} else if (attitude[axis] <= -OVER180) {