GPS/GNSS UBX library for UART
Dependencies: Vector3
Diff: GPSUBX_UART.hpp
- Revision:
- 19:ae1a294cb30b
- Parent:
- 13:facd8e54f2eb
diff -r e77382079cd9 -r ae1a294cb30b GPSUBX_UART.hpp --- a/GPSUBX_UART.hpp Mon Nov 29 12:32:42 2021 +0000 +++ b/GPSUBX_UART.hpp Wed Dec 01 05:29:32 2021 +0000 @@ -18,25 +18,19 @@ //extern Serial twelite; -//// 0x01 0x01 -//union POSECEF -//{ -// char byte_data[POSECEF_LEN+8]; -// struct -// { -// unsigned short sync; -// char m_class; -// char m_id; -// unsigned short pay_len; -// unsigned int iTOW; -// int ecefX; -// int ecefY; -// int ecefZ; -// unsigned int pAcc; -// char check_a; -// char check_b; -// } data; -//}; +// 0x01 0x01 +union POSECEF +{ + char byte_data[POSECEF_LEN]; + struct + { + unsigned int iTOW; + int ecefX; + int ecefY; + int ecefZ; + unsigned int pAcc; + } data; +}; // 0x01 0x02 union POSLLH @@ -192,6 +186,10 @@ /**Height [m]*/ volatile float Height; /**iTOW of POSLLH [ms]*/ + volatile int iTOW_POSECEF; + /**Velocity NED [m/s]*/ + volatile Vector3 PositionECEF; + /**Speed [m/s]*/ volatile int iTOW_POSLLH; /**Velocity NED [m/s]*/ volatile Vector3 VelocityNED; @@ -214,10 +212,11 @@ volatile int TimeZone; Vector3 UniversalZeroPosition; - Vector3 UniversalZeroUnitN; - Vector3 UniversalZeroUnitE; - Vector3 UniversalZeroUnitD; - Vector3 UniversalPosition; + float UniversalLatitude; + float UniversalLongitude; + Vector3 UniversalZeroUnit1; + Vector3 UniversalZeroUnit2; + Vector3 UniversalZeroUnit3; /**Position NED [m]*/ Vector3 PositionNED; @@ -235,13 +234,13 @@ */ void Attach(); - Vector3 ToUniversalUnit(); - Vector3 ToUniversal(); + //Vector3 ToUniversalUnit(); + //Vector3 ToUniversal(); void CalculateUnit(); /**call Calculate() before calculating PositionNED */ void Calculate(); - Vector3 Calculate(Vector3 position); + //Vector3 Calculate(Vector3 position); static void Checksum(char payload[], int n, char* ck_a, char* ck_b); };