GPS/GNSS UBX library for UART

Dependencies:   Vector3

Dependents:   GPS_0002

Revision:
17:2e6147aeba54
Parent:
13:facd8e54f2eb
--- a/GPSUBX_UART.hpp	Tue Nov 30 12:04:34 2021 +0000
+++ b/GPSUBX_UART.hpp	Fri Dec 10 10:41:56 2021 +0000
@@ -2,7 +2,13 @@
 #define __GPSUBX_UART_HPP__
 
 #include "mbed.h"
-#include "Vector3.hpp"
+// Eigen
+#include <Eigen/Dense.h>
+//#include <Eigen/Core.h>
+//#include <Eigen/LU.h>
+//#include <Eigen/Geometry.h>
+//using namespace std;
+using namespace Eigen;
 
 #define POSECEF_LEN 20
 #define POSLLH_LEN 28
@@ -16,6 +22,10 @@
 #define RECEIVE_SIZE 1024
 #define SENTENCE_SIZE 64
 
+#ifndef M_PI_F
+#define M_PI_F 3.141592f
+#endif
+
 //extern Serial twelite;
 
 //// 0x01 0x01
@@ -194,7 +204,7 @@
     /**iTOW of POSLLH [ms]*/
     volatile int iTOW_POSLLH;
     /**Velocity NED [m/s]*/
-    volatile Vector3 VelocityNED;
+    Vector3f VelocityNED;
     /**Speed [m/s]*/
     volatile float Speed;
     /**Ground speed [m/s]*/
@@ -213,13 +223,13 @@
     /**Time zone*/
     volatile int TimeZone;
         
-    Vector3 UniversalZeroPosition;
-    Vector3 UniversalZeroUnitN;
-    Vector3 UniversalZeroUnitE;
-    Vector3 UniversalZeroUnitD;
-    Vector3 UniversalPosition;
+    Vector3f UniversalZeroPosition;
+    Vector3f UniversalZeroUnitN;
+    Vector3f UniversalZeroUnitE;
+    Vector3f UniversalZeroUnitD;
+    Vector3f UniversalPosition;
     /**Position NED [m]*/
-    Vector3 PositionNED;
+    Vector3f PositionNED;
     
     /**Constructor
     *@param tx UART TX pin
@@ -235,13 +245,13 @@
     */
     void Attach();
     
-    Vector3 ToUniversalUnit();
-    Vector3 ToUniversal();
+    Vector3f ToUniversalUnit();
+    Vector3f ToUniversal();
     void CalculateUnit();
     /**call Calculate() before calculating PositionNED
     */
     void Calculate();
-    Vector3 Calculate(Vector3 position);
+    Vector3f Calculate(Vector3f position);
     
     static void Checksum(char payload[], int n, char* ck_a, char* ck_b);
 };