dpyeates / react-native-barometer

Provides barometric and altitude information for React-native apps for both IOS and Android.
MIT License
6 stars 1 forks source link

Fix setLocalPressure #1

Closed ryansommers closed 4 years ago

ryansommers commented 4 years ago

When using setLocalPressure() I was getting weird new altitudes, going from 293m with ASL to -90m after setting local hPa. It looks to me like the getAltitude() function needs to use STANDARD_ATMOSPHERE as the first argument, and not use the rawPressure at all.

Caveats: I know virtually nothing about Obj-C or barometric data, so if this isn't right, hopefully it at least helps with a fix.

ryansommers commented 4 years ago

Realize now of course we need rawPressure otherwise we don't know how it's changing. 🤦‍♂

Anyway, not sure what the issue is, other than getting those wrong values. For reference, I'm using setLocalPressure(968.76) with the Barometer reporting hPa of 978.7792 and getting a final altitude of -93