TeamSunride / MRAS

Multi Rocket Avionics System
https://mras.sunride.space/
GNU General Public License v3.0
6 stars 0 forks source link

Function to determine altitude from atmospheric pressure #20

Closed TomD53 closed 1 year ago

TomD53 commented 1 year ago

Task for @nikiexpo

Create a new branch for this

Please add header file(s) to the lib/shared folder

Add some native unit tests for the function that can be run using the pio test -e native command

Any questions please ask here or on discord!

nikiexpo commented 1 year ago

Finished writing the basic feature, can calculate altitude from pressure theoretically up to 80km, but need to write some tests, but is there any additional feature that needs to be added to this?

TomD53 commented 1 year ago

Sounds good, please make some commits to a separate branch and we shall do some code review

nikiexpo commented 1 year ago

Done, will send the additional files and math working in the discord

nikiexpo commented 1 year ago

ICAO_standard.pdf Reference

TomD53 commented 1 year ago

Unit tests:

The above two tests should run in native environment

Please add tests for anything else that could go wrong

TomD53 commented 1 year ago

Please also add a page in the docs folder to explain how this class works and add doxygen strings above each function/class to describe how they work and inputs/outputs

Refer to the documentation guide: https://mras.sunride.space/md_docs_documentation_guide.html

nikiexpo commented 1 year ago
image
TomD53 commented 1 year ago

TODO list:

TomD53 commented 1 year ago

Above 101325Pa set altitude to 0

TomD53 commented 1 year ago

Updated view of graph with grid and higher x-axis resolution of 1Pa image

TomD53 commented 1 year ago

Zoomed in view of discontinuity at P=101325, to be fixed by setting altitude=0 when P>101325 image

nikiexpo commented 1 year ago

image image Done

nikiexpo commented 1 year ago

@TomD53 Where do I put the md file, do i create a new folder within docs/

nikiexpo commented 1 year ago

nevermind, I think I got it :')

nikiexpo commented 1 year ago

IGNORE, testing something

$\text{if} \beta \neq 0$ $$H = H_b + \frac{T_b}{\beta} ((\frac{P_b}{P})^{\frac{\beta R}{g_0}} - 1)$$ $\text{if} \beta = 0$ $$H = H_b + \frac{RT}{g_0} ln({\frac{P_b}{P}})$$

nikiexpo commented 1 year ago

image image