DataKML.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2021 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #ifndef DATA_KML_H
14 #define DATA_KML_H
15 
16 // #include <stdio.h>
17 #include <string>
18 #include <vector>
19 
20 #include "tinyxml.h"
21 #include "com_manager.h"
22 
23 #ifdef USE_IS_INTERNAL
24 # include "../../cpp/libs/IS_internal.h"
25 #endif
26 
27 using namespace std;
28 
30 {
31  double time;
32  double lla[3];
33  float theta[3];
35  sKmlLogData(double _time, double _lla[3], float _theta[3])
36  {
37  time = _time;
38  lla[0] = _lla[0];
39  lla[1] = _lla[1];
40  lla[2] = _lla[2];
41  theta[0] = _theta[0];
42  theta[1] = _theta[1];
43  theta[2] = _theta[2];
44  }
45 
46  sKmlLogData(unsigned int _timeMs, double _lla[3])
47  {
48  time = _timeMs*0.001;
49  lla[0] = _lla[0];
50  lla[1] = _lla[1];
51  lla[2] = _lla[2];
52  theta[0] = theta[1] = theta[2] = 0;
53  }
54 };
55 
56 
57 class cDataKML
58 {
59 public:
60  enum MyEnum
61  {
62  KID_INS = 0,
69  };
70 
71  static inline int DID_TO_KID(int did)
72  {
73  switch (did)
74  {
75  default: return -1; // Unused
76  case DID_INS_1: return KID_INS;
77  case DID_GPS1_POS: return KID_GPS;
78  case DID_GPS1_UBX_POS: return KID_GPS1;
79  case DID_GPS2_POS: return KID_GPS2;
80  case DID_GPS1_RTK_POS: return KID_RTK;
81  }
82  }
83 
84  static inline int BYTES_PER_KID(int kid)
85  {
86  switch (kid)
87  {
88  default:
89  return -1; // Unused
90  case KID_INS:
91  return 130;
92  case KID_GPS:
93  case KID_GPS1:
94  case KID_GPS2:
95  case KID_RTK:
96  return 65;
97  }
98  }
99 
100  cDataKML();
101  string GetDatasetName(int kid);
102  int WriteDataToFile(vector<sKmlLogData>& list, const p_data_hdr_t* dataHdr, const uint8_t* dataBuf);
103 };
104 
105 #endif // DATA_KML_H
#define DID_INS_1
Definition: data_sets.h:38
#define DID_GPS1_UBX_POS
Definition: data_sets.h:40
double time
Definition: DataKML.h:31
#define DID_GPS2_POS
Definition: data_sets.h:48
sKmlLogData()
Definition: DataKML.h:34
static int DID_TO_KID(int did)
Definition: DataKML.h:71
#define DID_GPS1_POS
Definition: data_sets.h:47
sKmlLogData(unsigned int _timeMs, double _lla[3])
Definition: DataKML.h:46
#define DID_GPS1_RTK_POS
Definition: data_sets.h:88
static int BYTES_PER_KID(int kid)
Definition: DataKML.h:84
sKmlLogData(double _time, double _lla[3], float _theta[3])
Definition: DataKML.h:35


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57