GNSS學習筆記-坐標轉換


GNSS 坐標轉換

GNSS計算主要涉及三個坐標系,地心地固坐標系地理坐標系站心坐標系。這里主要介紹一下三個坐標的含義和轉換公式。

  • 地心地固坐標系如圖X,Y,Z表示 (ECEF坐標系),以地心O為坐標原點,Z軸指向協議地球北極,X軸指向參考子午面與地球赤道的交點,也叫地球坐標系。一般GNSS坐標計算都在地心地固坐標系下進行的。由於地球是橢圓形,有WGS-84和CGC2000等多種標准

  • 地理坐標系則通過經度(longitude),緯度(latitude)和高度(altitude)來表示地球的位置,也叫經緯高坐標系(LLA坐標系)。

  • 站心坐標系以用戶所在位置P為坐標原點,三個軸分別指向東向,北向和天向,也叫東北天坐標系(enu坐標系)。站心坐標系的天向方向和地理坐標系的高度方向是一致的。站心坐標系用在慣性導航和衛星俯仰角計算中較多。

參數 WGS-84 CGC200
基准橢球體的長半徑a 6378137.0 m 6378137.0 m
基准橢球體的極扁率f 1/298.257223565 1/298.257223563
地球自轉角速度We 7.2921151467*1e-5 7.2921151467*1e-5
地球引力和地球質量的乘積GM 3986004.418*1e8 3986004.418*1e8
光速 2.99792458*1e8 m/s 2.99792458*1e8 m/s


LLA坐標系轉ECEF坐標系

LLA坐標系下的(lon,lat,alt)轉換為ECEF坐標系下點(X,Y,Z)

\[\begin{cases} X=(N+alt)cos(lat)cos(lon)\\ Y=(N+alt)cos(lat)sin(lon)\\ Z=(N(1-e^2)+alt)sin(lat) \end{cases}\]

其中e為橢球偏心率,N為基准橢球體的曲率半徑

\[\begin{cases} e^2=\frac{a^2-b^2}{a^2}\\ N=\frac{a}{\sqrt{1-e^2sin^2lat}} \end{cases}\]

由於WGS-84下極扁率\(f=\frac{a-b}{a}\),偏心率e和極扁率f之間的關系:

\[e^2=f(2-f) \]

坐標轉換公式也可以為

\[\begin{cases} X=(N+alt)cos(lat)cos(lon)\\ Y=(N+alt)cos(lat)sin(lon)\\ Z=(N(1-f)^2+alt)sin(lat) \end{cases}\]

\[N=\frac{a}{\sqrt{1-f(2-f)sin^2lat}} \]

python實現

def lla2ecef(lat,lon,alt):
    WGS84_A = 6378137.0
    WGS84_f = 1/298.257223565
    WGS84_E2 = WGS84_f*(2-WGS84_f)
    deg2rad = math.pi/180.0
    rad2deg = 180.0/math.pi
    lat *= deg2rad
    lon *= deg2rad
    N = WGS84_A/(math.sqrt(1-WGS84_E2*math.sin(lat)*math.sin(lat)))
    x = (N+alt)*math.cos(lat)*math.cos(lon)
    y = (N+alt)*math.cos(lat)*math.sin(lon)
    z = (N*(1-WGS84_f)*(1-WGS84_f)+alt)*math.sin(lat)
    return [x,y,z]

ECEF坐標系轉LLA坐標系

ECEF坐標系下點(X,Y,Z)轉換為LLA坐標系下的(lon,lat,alt)

\[lon=arctan(\frac{y}{x}) \]

\[alt=\frac{p}{cos(lat)-N} \]

\[lat=arctan\bigg[\frac{z}{p}\bigg(1-e^2\frac{N}{N+alt}\bigg)^{-1}\bigg] \]

\[p=\sqrt{x^2+y^2} \]

一開始lon是未知的,可以假設為0,經過幾次迭代之后就能收斂

ECEF坐標系轉enu坐標系

用戶所在坐標點\(P_0=(x_0,y_0,z_0)\),,計算點\(P=(x,y,z)\)在以點\(P_{0}\)為坐標原點的enu坐標系位置\((e,n,u)\)這里需要用到LLA坐標系的數據,\(P_0\)的LLA坐標點為\(LLA_0=(lon_0,lat_0,alt_0)\)

\[\begin{gathered} \left[ \begin{array}{ccc} \Delta{x}\\\Delta{y}\\\Delta{z} \end{array} \right]= \left[ \begin{array}{ccc} x\\y\\z\end{array}\right]- \left[ \begin{array}{ccc} x_0\\y_0\\z_0\end{array}\right] \end{gathered} \]

\[\begin{gathered} \left[ \begin{array}{ccc} e\\n\\u \end{array} \right]=S\cdot \left[ \begin{array}{ccc} \Delta{x}\\\Delta{y}\\\Delta{z} \end{array} \right] \end{gathered}= \left[ \begin{array}{ccc} -sin(lon_0) & cos(lon_0) & 0 \\ -sin(lat_0)cos(lon_0) & -sin(lat_0)sin(lon_0) & cos(lat_0) \\ cos(lat_0)cos(lon_0) & cos(lat_0)sin(lon_0) & sin(lat_0) \end{array} \right]\cdot \left[ \begin{array}{ccc} \Delta{x}\\\Delta{y}\\\Delta{z} \end{array} \right] \]

即坐標變換矩陣\(S=\left[ \begin{array}{ccc} -sin(lon_0) & cos(lon_0) & 0 \\ -sin(lat_0)cos(lon_0) & -sin(lat_0)sin(lon_0) & cos(lat_0) \\ cos(lat_0)cos(lon_0) & cos(lat_0)sin(lon_0) & sin(lat_0) \end{array} \right]\)

enu坐標系轉ECEF坐標系

\(S\)為單位正交矩陣

\[\mathbf{S}^{-1}=\mathbf{S}^\mathrm{T} \]

反之

\[\begin{gathered} \left[ \begin{array}{ccc} \Delta{x}\\\Delta{y}\\\Delta{z}\end{array} \right]=S^{-1}\cdot\left[ \begin{array}{ccc} e\\n\\u\end{array} \right]= \mathbf{S}^\mathrm{T}\cdot\left[ \begin{array}{ccc} e\\n\\u\end{array} \right] \end{gathered} \]

LLA坐標系轉enu坐標系

上述可以看到,從LLA坐標系轉換到enu坐標系有較多計算量,在考慮地球偏心率\(e\)很小的前提下,可以做一定的近似公式計算

\[\left[ \begin{array}{ccc} \Delta e\\ \Delta n \\ \Delta u \end{array} \right]= \left[\begin{array}{ccc} a\cdot cos(lat)\cdot \Delta lon & 0 & 0 \\ 0 & a \cdot \Delta lat & 0 \\ 0 & 0 & \Delta alt \end{array} \right] \]


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM