GPS module (GYSFDMAXB) 57600 bps
Dependents: HAPS_GPS_Test_0001
GYSFDMAXB GPSセンサーGYSFDMAXBのライブラリ 57600 bps
手順 [1] シリアルピンを設定 GYSFDMAXB gps(tx_pin, rx_pin); [2] 零点を設定する(NED座標系における零点) gps.Initialize(); [3] 自動的にデータを受信しては更新していくので、適宜メンバ変数を読み込んで使う
GYSFDMAXB.hpp
- Committer:
- cocorlow
- Date:
- 2021-04-08
- Revision:
- 2:9b567c8f5429
- Parent:
- 1:0d9b4ba850d8
- Child:
- 3:f8045f83d7c1
File content as of revision 2:9b567c8f5429:
#ifndef __GYSFDMAXB_HPP__ #define __GYSFDMAXB_HPP__ #include "mbed.h" #include "Vector3.hpp" /* $GPZDA,030049.971,06,04,2021,,*54 $GPGGA,030050.971,,,,,0,0,,,M,,M,,*41 $GPGLL,,,,,030050.971,V,N*73 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,030050.971,V,,,,,0.00,0.00,060421,,,N*45 $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 $GPZDA,030050.971,06,04,2021,,*5C $GPGGA,030051.971,,,,,0,0,,,M,,M,,*40 $GPGLL,,,,,030051.971,V,N*72 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,030051.971,V,,,,,0.00,0.00,060421,,,N*44 $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 $GPZDA,030051.971,06,04,2021,,*5D */ class GYSFDMAXB { private: float height; Serial serial; bool receive_flag; int start_index; const int start_size = 16; char* uart_start[start_size]; int uart_index; const int uart_size = 1024; char uart_buffer[uart_size]; static const float Radius = 6378136.6; public: // GPGGA int Quality; int Satellites; float HDOP; float Elevation; char UnitElevation; float GeoidElevation; char UnitGeoidElevation; // GPRMC int Hours; int Minutes; int Seconds; int Milliseconds; char Status; float Latitude; char N_S; float Longitude; char E_W; float Speed; float Direction; int Day; int Month; int Year; float GeomagneticDeclination ; char GeomagneticE_W; char Mode; Vector3 UniversalZeroPosition; Vector3 UniversalZeroUnitN; Vector3 UniversalZeroUnitE; Vector3 UniversalZeroUnitD; Vector3 UniversalPosition; Vector3 Position; GYSFDMAXB(PinName tx, PinName rx); void Receive(); void Update(); Vector3 ToUniversalUnit(); Vector3 ToUniversal(); void CalcurateUnit(); void Calcurate(); Vector3 Calcurate(Vector3 position); }; extern Serial pc; #endif