Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AGL altitude calculation for fixed landing gears and reorganize t… #35

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

jmbau
Copy link
Collaborator

@jmbau jmbau commented Nov 6, 2022

…his code a little bit.

AGL altitude calculation when landing is actually wrong for aircrafts with fixed landing gear: it's visible because when a such helicopter lands, AGL altitude gradually decreases, then suddenly drops to zero. This fix it.

Remarks:

  • In v1 distance calculation, I added gear_state == 2 which means landing gear "down/deployed/out and fixed". This gear state was already defined in SARSimOpLandingGear(...) in simutils.c, lines 917 to 923.
  • Of course instead of (gear_state == 1) || (gear_state == 2) it is possible to write gear_state >= 1 but I think that it is less clear, and more risky if a new gear state is added later.
  • Regarding code reorganization, I think that it makes more sense now: first, calculate the value, then, convert it to the right unit.
  • At take off, whatever landing gear type, AGL altitude suddently jumps from zero to 0.3m (~ 1.0ft): this is because of sfmsimforce.c, line 1635.

@hsanjuan hsanjuan merged commit 74deace into master Jul 31, 2023
@hsanjuan hsanjuan deleted the fix-AGL-altitude-calculation branch July 31, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants