mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-09-29 05:17:33 +00:00
bugfixes for pressure-based altitude estimation
This commit is contained in:
@@ -19,7 +19,7 @@ class AltitudeModel:
|
||||
alt_b (float, optional): The reference altitude in meters. Defaults to 0m.
|
||||
unit (PressUnit, optional): The unit used for all pressure values. Defaults to PressUnit.hPa.
|
||||
"""
|
||||
self.__press_0 = press_b / (1 - (alt_b / 44330)**5255)
|
||||
self.__press_0 = press_b / (1 - (alt_b / 44330)**5.255)
|
||||
|
||||
def predict(self, press: float, unit: PressUnit = PressUnit.hPa) -> float:
|
||||
"""Estimates the altitude based on a pressure measurement.
|
||||
@@ -41,4 +41,4 @@ class AltitudeModel:
|
||||
|
||||
press = to_hpa[unit]
|
||||
|
||||
return 44330 * (1 - (press / self.__press_0)**(1 / 5255))
|
||||
return 44330 * (1 - (press / self.__press_0)**(1 / 5.255))
|
||||
|
Reference in New Issue
Block a user