Rev 966 | Rev 973 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 966 | Rev 972 | ||
---|---|---|---|
Line 166... | Line 166... | ||
166 | { |
166 | { |
167 | DeltaAltitude = CurrentAltitude - LastAltitude; |
167 | DeltaAltitude = CurrentAltitude - LastAltitude; |
168 | LastAltitude = CurrentAltitude; |
168 | LastAltitude = CurrentAltitude; |
169 | } |
169 | } |
170 | AirPressureCnt++; |
170 | AirPressureCnt++; |
171 | 171 | ||
172 | //if ((GPS_Roll == 0 && GPS_Nick == 0) || (maxDistance / 10 > 10)) |
172 | //if ((GPS_Roll == 0 && GPS_Nick == 0) || (maxDistance / 10 > 10)) |
173 | { |
173 | { |
174 | Roll_X_Offset = 0.9995F * Roll_X_Offset + 0.0005F * (float) (MAX(-60, MIN(60,AverageRoll_X))); |
174 | Roll_X_Offset = 0.9995F * Roll_X_Offset + 0.0005F * (float) (MAX(-60, MIN(60,AverageRoll_X))); |
175 | Roll_Y_Offset = 0.9995F * Roll_Y_Offset + 0.0005F * (float) (MAX(-60, MIN(60,AverageRoll_Y))); |
175 | Roll_Y_Offset = 0.9995F * Roll_Y_Offset + 0.0005F * (float) (MAX(-60, MIN(60,AverageRoll_Y))); |
Line 176... | Line 176... | ||
176 | 176 | ||
177 | if (abs(StickGier) < 15 || MotorenEin == 0) |
177 | if (abs(StickGier) < 15 || MotorenEin == 0) |
178 | { |
178 | { |
179 | Roll_Z_Offset = 0.9998F * Roll_Z_Offset + 0.0002F * (float) ( MAX(-60, MIN(60,AverageRoll_Z))); |
179 | Roll_Z_Offset = 0.9998F * Roll_Z_Offset + 0.0002F * (float) ( MAX(-60, MIN(60,AverageRoll_Z))); |
180 | } |
180 | } |
Line 181... | Line 181... | ||
181 | } |
181 | } |
182 | 182 | ||
Line 417... | Line 417... | ||
417 | int StickNick45,StickRoll45; |
417 | int StickNick45,StickRoll45; |
418 | int DiffNick,DiffRoll, DiffGier; |
418 | int DiffNick,DiffRoll, DiffGier; |
419 | int motorwert = 0; |
419 | int motorwert = 0; |
420 | int pd_ergebnis; |
420 | int pd_ergebnis; |
Line 421... | Line -... | ||
421 | - | ||
422 | 421 | ||
423 | /***************************************************************************** |
422 | /***************************************************************************** |
424 | Update noimial attitude |
423 | Update noimial attitude |
425 | **************************************************************************** */ |
424 | **************************************************************************** */ |
426 | if(!NewPpmData--) |
425 | if(!NewPpmData--) |
Line 472... | Line 471... | ||
472 | DescentCnt = 32000; |
471 | DescentCnt = 32000; |
473 | } |
472 | } |
Line 474... | Line 473... | ||
474 | 473 | ||
Line -... | Line 474... | ||
- | 474 | //DebugOut.Analog[13] = (int) GasMischanteil; |
|
475 | //DebugOut.Analog[13] = (int) GasMischanteil; |
475 | |
476 | 476 | #ifdef X_FORMATION |
|
477 | /* Overide in case the remote link got lost */ |
477 | /* Overide in case the remote link got lost */ |
478 | if (RemoteLinkLost == 0) |
478 | if (RemoteLinkLost == 0) |
479 | { /* We are flying in X-Formation */ |
479 | { /* We are flying in X-Formation */ |
Line 484... | Line 484... | ||
484 | { /* GPS overide is aktive */ |
484 | { /* GPS overide is aktive */ |
485 | StickRoll45 = (int) (0.707F * (float)(-GPS_Roll) - 0.707F * (float)(-GPS_Nick)); |
485 | StickRoll45 = (int) (0.707F * (float)(-GPS_Roll) - 0.707F * (float)(-GPS_Nick)); |
486 | StickNick45 = (int) (0.707F * (float)(-GPS_Roll) + 0.707F * (float)(-GPS_Nick)); |
486 | StickNick45 = (int) (0.707F * (float)(-GPS_Roll) + 0.707F * (float)(-GPS_Nick)); |
487 | StickGier = 0; |
487 | StickGier = 0; |
488 | } |
488 | } |
- | 489 | #else |
|
- | 490 | /* Overide in case the remote link got lost */ |
|
- | 491 | if (RemoteLinkLost == 0) |
|
- | 492 | { /* We are flying in X-Formation */ |
|
- | 493 | StickRoll45 = StickRoll - GPS_Roll; |
|
- | 494 | StickNick45 = StickNick - GPS_Nick; |
|
- | 495 | } |
|
- | 496 | else |
|
- | 497 | { /* GPS overide is aktive */ |
|
- | 498 | StickRoll45 = -GPS_Roll; |
|
- | 499 | StickNick45 = -GPS_Nick; |
|
- | 500 | StickGier = 0; |
|
- | 501 | } |
|
- | 502 | #endif |
|
- | 503 | ||
489 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
504 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
490 | // Yaw |
505 | // Yaw |
491 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
506 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Line 492... | Line 507... | ||
492 | 507 |