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@3:f8045f83d7c1, 2021-04-22 (annotated)
- Committer:
- cocorlow
- Date:
- Thu Apr 22 11:51:16 2021 +0000
- Revision:
- 3:f8045f83d7c1
- Parent:
- 2:9b567c8f5429
- Child:
- 4:8d315f7977b3
- Child:
- 5:6fc37ae3f262
error
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cocorlow | 3:f8045f83d7c1 | 1 | //#ifndef __GYSFDMAXB_HPP__ |
cocorlow | 3:f8045f83d7c1 | 2 | //#define __GYSFDMAXB_HPP__ |
cocorlow | 3:f8045f83d7c1 | 3 | // |
cocorlow | 3:f8045f83d7c1 | 4 | //#include "mbed.h" |
cocorlow | 3:f8045f83d7c1 | 5 | //#include "Vector3.hpp" |
cocorlow | 3:f8045f83d7c1 | 6 | // |
cocorlow | 3:f8045f83d7c1 | 7 | ///* |
cocorlow | 3:f8045f83d7c1 | 8 | //$GPZDA,030049.971,06,04,2021,,*54 |
cocorlow | 3:f8045f83d7c1 | 9 | //$GPGGA,030050.971,,,,,0,0,,,M,,M,,*41 |
cocorlow | 3:f8045f83d7c1 | 10 | //$GPGLL,,,,,030050.971,V,N*73 |
cocorlow | 3:f8045f83d7c1 | 11 | //$GPGSA,A,1,,,,,,,,,,,,,,,*1E |
cocorlow | 3:f8045f83d7c1 | 12 | //$GPGSV,1,1,00*79 |
cocorlow | 3:f8045f83d7c1 | 13 | //$GPRMC,030050.971,V,,,,,0.00,0.00,060421,,,N*45 |
cocorlow | 3:f8045f83d7c1 | 14 | //$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 |
cocorlow | 3:f8045f83d7c1 | 15 | //$GPZDA,030050.971,06,04,2021,,*5C |
cocorlow | 3:f8045f83d7c1 | 16 | //$GPGGA,030051.971,,,,,0,0,,,M,,M,,*40 |
cocorlow | 3:f8045f83d7c1 | 17 | //$GPGLL,,,,,030051.971,V,N*72 |
cocorlow | 3:f8045f83d7c1 | 18 | //$GPGSA,A,1,,,,,,,,,,,,,,,*1E |
cocorlow | 3:f8045f83d7c1 | 19 | //$GPGSV,1,1,00*79 |
cocorlow | 3:f8045f83d7c1 | 20 | //$GPRMC,030051.971,V,,,,,0.00,0.00,060421,,,N*44 |
cocorlow | 3:f8045f83d7c1 | 21 | //$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 |
cocorlow | 3:f8045f83d7c1 | 22 | //$GPZDA,030051.971,06,04,2021,,*5D |
cocorlow | 3:f8045f83d7c1 | 23 | //*/ |
cocorlow | 3:f8045f83d7c1 | 24 | // |
cocorlow | 3:f8045f83d7c1 | 25 | // |
cocorlow | 3:f8045f83d7c1 | 26 | //class GYSFDMAXB |
cocorlow | 3:f8045f83d7c1 | 27 | //{ |
cocorlow | 3:f8045f83d7c1 | 28 | //private: |
cocorlow | 3:f8045f83d7c1 | 29 | // float height; |
cocorlow | 3:f8045f83d7c1 | 30 | // Serial serial; |
cocorlow | 3:f8045f83d7c1 | 31 | // bool receive_flag; |
cocorlow | 3:f8045f83d7c1 | 32 | // const int start_size = 16; |
cocorlow | 3:f8045f83d7c1 | 33 | // char* uart_start[start_size]; |
cocorlow | 3:f8045f83d7c1 | 34 | // const int phrase_length = 128; |
cocorlow | 3:f8045f83d7c1 | 35 | // const char phrase_buffer[start_size][phrase_length]; |
cocorlow | 3:f8045f83d7c1 | 36 | // const int uart_size = 2048; |
cocorlow | 3:f8045f83d7c1 | 37 | // char uart_buffer[uart_size]; |
cocorlow | 3:f8045f83d7c1 | 38 | // char gpgga[phrase_length]; |
cocorlow | 3:f8045f83d7c1 | 39 | // char gprmc[phrase_length]; |
cocorlow | 3:f8045f83d7c1 | 40 | // |
cocorlow | 3:f8045f83d7c1 | 41 | // static const float Radius = 6378136.6f; |
cocorlow | 3:f8045f83d7c1 | 42 | // |
cocorlow | 3:f8045f83d7c1 | 43 | // void Receive(); |
cocorlow | 3:f8045f83d7c1 | 44 | // |
cocorlow | 3:f8045f83d7c1 | 45 | //public: |
cocorlow | 3:f8045f83d7c1 | 46 | // // GPGGA |
cocorlow | 3:f8045f83d7c1 | 47 | // int start_index; |
cocorlow | 3:f8045f83d7c1 | 48 | // int uart_index; |
cocorlow | 3:f8045f83d7c1 | 49 | // |
cocorlow | 3:f8045f83d7c1 | 50 | // int Quality; |
cocorlow | 3:f8045f83d7c1 | 51 | // int Satellites; |
cocorlow | 3:f8045f83d7c1 | 52 | // float HDOP; |
cocorlow | 3:f8045f83d7c1 | 53 | // float Elevation; |
cocorlow | 3:f8045f83d7c1 | 54 | // char UnitElevation; |
cocorlow | 3:f8045f83d7c1 | 55 | // float GeoidElevation; |
cocorlow | 3:f8045f83d7c1 | 56 | // char UnitGeoidElevation; |
cocorlow | 3:f8045f83d7c1 | 57 | // |
cocorlow | 3:f8045f83d7c1 | 58 | // // GPRMC |
cocorlow | 3:f8045f83d7c1 | 59 | // int Hours; |
cocorlow | 3:f8045f83d7c1 | 60 | // int Minutes; |
cocorlow | 3:f8045f83d7c1 | 61 | // int Seconds; |
cocorlow | 3:f8045f83d7c1 | 62 | // int Milliseconds; |
cocorlow | 3:f8045f83d7c1 | 63 | // char Status; |
cocorlow | 3:f8045f83d7c1 | 64 | // float Latitude; |
cocorlow | 3:f8045f83d7c1 | 65 | // char N_S; |
cocorlow | 3:f8045f83d7c1 | 66 | // float Longitude; |
cocorlow | 3:f8045f83d7c1 | 67 | // char E_W; |
cocorlow | 3:f8045f83d7c1 | 68 | // float Speed; |
cocorlow | 3:f8045f83d7c1 | 69 | // float Direction; |
cocorlow | 3:f8045f83d7c1 | 70 | // int Day; |
cocorlow | 3:f8045f83d7c1 | 71 | // int Month; |
cocorlow | 3:f8045f83d7c1 | 72 | // int Year; |
cocorlow | 3:f8045f83d7c1 | 73 | // float GeomagneticDeclination ; |
cocorlow | 3:f8045f83d7c1 | 74 | // char GeomagneticE_W; |
cocorlow | 3:f8045f83d7c1 | 75 | // char Mode; |
cocorlow | 3:f8045f83d7c1 | 76 | // |
cocorlow | 3:f8045f83d7c1 | 77 | // Vector3 UniversalZeroPosition; |
cocorlow | 3:f8045f83d7c1 | 78 | // Vector3 UniversalZeroUnitN; |
cocorlow | 3:f8045f83d7c1 | 79 | // Vector3 UniversalZeroUnitE; |
cocorlow | 3:f8045f83d7c1 | 80 | // Vector3 UniversalZeroUnitD; |
cocorlow | 3:f8045f83d7c1 | 81 | // Vector3 UniversalPosition; |
cocorlow | 3:f8045f83d7c1 | 82 | // Vector3 Position; |
cocorlow | 3:f8045f83d7c1 | 83 | // |
cocorlow | 3:f8045f83d7c1 | 84 | // GYSFDMAXB(PinName tx, PinName rx); |
cocorlow | 3:f8045f83d7c1 | 85 | // void Update(); |
cocorlow | 3:f8045f83d7c1 | 86 | // void Initialize(); |
cocorlow | 3:f8045f83d7c1 | 87 | // Vector3 ToUniversalUnit(); |
cocorlow | 3:f8045f83d7c1 | 88 | // Vector3 ToUniversal(); |
cocorlow | 3:f8045f83d7c1 | 89 | // void CalcurateUnit(); |
cocorlow | 3:f8045f83d7c1 | 90 | // void Calcurate(); |
cocorlow | 3:f8045f83d7c1 | 91 | // Vector3 Calcurate(Vector3 position); |
cocorlow | 3:f8045f83d7c1 | 92 | //}; |
cocorlow | 3:f8045f83d7c1 | 93 | // |
cocorlow | 3:f8045f83d7c1 | 94 | //extern Serial pc; |
cocorlow | 3:f8045f83d7c1 | 95 | // |
cocorlow | 3:f8045f83d7c1 | 96 | //#endif |