GPS/GNSS UBX library for UART

Dependencies:   Vector3

Dependents:   GPS_0002

Files at this revision

API Documentation at this revision

Comitter:
NaotoMorita
Date:
Tue Jun 21 04:59:05 2022 +0000
Parent:
20:efa07b922ba7
Commit message:
without verctor3

Changed in this revision

GPSUBX_UART.cpp Show annotated file Show diff for this revision Revisions of this file
GPSUBX_UART.hpp Show annotated file Show diff for this revision Revisions of this file
diff -r efa07b922ba7 -r 712076ece407 GPSUBX_UART.cpp
--- a/GPSUBX_UART.cpp	Thu Mar 31 02:15:19 2022 +0000
+++ b/GPSUBX_UART.cpp	Tue Jun 21 04:59:05 2022 +0000
@@ -208,12 +208,18 @@
     //twelite.printf("%f %f %f \r\n",_n,_e,_d);
 }
 
-void GPSUBX_UART::Calculate()
+void GPSUBX_UART::Calculate(float& posN,float& posE,float& posD,float& velN,float& velE,float& velD)
 {
     UniversalPosition = ToUniversal();
     Vector3 relative = UniversalPosition - UniversalZeroPosition;
     Vector3 _position(relative % UniversalZeroUnitN, relative % UniversalZeroUnitE, relative % UniversalZeroUnitD);
     PositionNED = _position;
+    posN = _position.x;
+    posE = _position.y;
+    posD = _position.z;
+    velN = VelocityNED.x;
+    velE = VelocityNED.y;
+    velD = VelocityNED.z;
 }
 
 Vector3 GPSUBX_UART::Calculate(Vector3 position)
diff -r efa07b922ba7 -r 712076ece407 GPSUBX_UART.hpp
--- a/GPSUBX_UART.hpp	Thu Mar 31 02:15:19 2022 +0000
+++ b/GPSUBX_UART.hpp	Tue Jun 21 04:59:05 2022 +0000
@@ -242,7 +242,7 @@
     void CalculateUnit();
     /**call Calculate() before calculating PositionNED
     */
-    void Calculate();
+    void Calculate(float& posN,float& posE,float& posD,float& velN,float& velE,float& velD);
     Vector3 Calculate(Vector3 position);
     
     static void Checksum(char payload[], int n, char* ck_a, char* ck_b);