問題描述
計算氣壓高度需要哪些數據?我如何得到它們然后計算高度?
What are the data needed for calculating barometric altitude? How do I get them and then calculate the altitude?
與 GPS 高度相比,氣壓的準確度如何?我嘗試了 GPS,但在網上搜索了幾個小時后,我找不到合適的大地水準面庫.
Also how accurate is the barometric compared to GPS altitude? I tried GPS but after searching hours in the web I cannot find a suitable Geoid library.
如果我有任何概念,請糾正我.
Please correct me if I got any concept long.
推薦答案
你需要使用壓力傳感器 測量壓力然后使用 SensorManager.getAltitude(float, float) 調用以將測量壓力與參考海平面壓力一起轉換以獲得高度.
You need to use the pressure sensor to measure the pressure then use the SensorManager.getAltitude(float, float) call to convert the measures pressure along with a reference sea level pressure to get the altitude.
棘手的一點是使用什么作為參考壓力.這會隨著天氣的變化而變化,并且會隨著時間的推移而漂移.通常,您會進行某種校準以設置此值并可能對其進行更新.這取決于您的用例,什么是正確的解決方案.
The tricky bit is what to use as the reference pressure. This will change with the weather and will drift over time. Typically you would do some sort of calibration to set this values and possibly update it. It depends on your use case what the right solution is.
如果正確校準的基于壓力的高度比基于 gps 的高度要準確得多,尤其是如果您希望對高度差異而不是絕對高度感興趣.通過對原始壓力傳感器值進行一些過濾,您可以輕松地檢測到您將手機保持在面部水平或頭頂手臂長度,這是您想要使用 gps 執行的操作.
If properly calibrated pressure based altitude is considerably more accurate then gps based altitude especially if want you are interested in is altitude differences rather than absolute altitudes. With a bit of filtering on the raw pressure sensor values you can easily detect holding the phone at face level or arms length above your head which you want do with gps.
這篇關于如何在Android中獲得氣壓高度?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!