source: flair-src/trunk/lib/FlairCore/src/GpsData.h@ 167

Last change on this file since 167 was 167, checked in by Sanahuja Guillaume, 5 years ago

modifs pour template vectors

File size: 5.0 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5/*!
6 * \file GpsData.h
7 * \brief Class defining gps datas
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2016/07/01
10 * \version 4.0
11 */
12#ifndef GPSDATA_H
13#define GPSDATA_H
14
15#include <io_data.h>
16
17namespace flair {
18namespace core {
19
20 class IODataElement;
21
22/*! \class GpsData
23*
24* \brief Class defining gps datas
25*
26* GPS datas consist of
27*
28*
29*/
30class GpsData : public io_data {
31public:
32 class Type : public DataType {
33 public:
34 Type(void){}
35 std::string GetDescription() const { return "gps data"; }
36 size_t GetSize() const {
37 size_t size = 0;
38 size += 2*doubleType.GetSize(); // Latitude, Longitude
39 size += floatType.GetSize(); // Altitude
40 size += UInt8Type.GetSize(); // NumberOfSatellites
41 size += UInt8Type.GetSize(); // FixQuality_t
42 size += 5*floatType.GetSize();//e,n,u,ve,vn
43 return size;
44 }
45
46 private:
47 };
48
49 /*!
50 \enum PlotableData_t
51 \brief Datas wich can be plotted in a DataPlot1D
52 */
53 typedef enum {
54 Latitude /*! latitude in degrees */,
55 Longitude /*! longitude in degrees */,
56 Altitude /*! altitude */,
57 NumberOfSatellites /*! number of satellites */,
58 FixQuality /*! fix quality */,
59 East /*! east */,
60 North /*! north */,
61 Up /*! up */,
62 EastVelocity /*! east velocity*/,
63 NorthVelocity /*! north velocity*/,
64 } PlotableData_t;
65
66 /*!
67 \enum FixQuality_t
68 \brief Fix qualty indicators
69 */
70 enum class FixQuality_t : uint8_t {
71 Invalid = 0, /*!< invalid */
72 Gps = 1, /*!< Gps */
73 DGps = 2, /*!< Differential Gps */
74 Pps = 3, /*!< Pps */
75 Rtk = 4, /*!< RTK */
76 RtkFloat = 5, /*!< RTK float */
77 Estimated = 6, /*!< Estimated */
78 Manual = 7, /*!< Manual */
79 Simulation = 8, /*!< Simulation */
80 };
81
82 /*!
83 * \brief Constructor
84 *
85 * Construct an io_data representing GPS datas. \n
86 *
87 * \param parent parent
88 * \param name name
89 * \param n number of samples
90 */
91 GpsData(const Object *parent, std::string name = "", int n = 1);
92
93 /*!
94 * \brief Destructor
95 *
96 */
97 ~GpsData();
98
99 /*!
100 * \brief Element
101 *
102 * Get a pointer to a specific element. This pointer can be used for plotting.
103 *
104 * \param data_type data type
105 *
106 * \return pointer to the element
107 */
108 IODataElement *Element(PlotableData_t data_type) const;
109
110 /*!
111 * \brief Get latitude, longitude and altitude
112 *
113 * This method is mutex protected.
114 *
115 * \param latitude latitude
116 * \param longitude longitude
117 * \param altitude altitude
118 *
119 */
120 void GetLla(double &latitude, double &longitude,
121 float &altitude) const;
122
123 /*!
124 * \brief Set latitude, longitude and altitude
125 *
126 * This method is mutex protected.
127 *
128 * \param latitude latitude
129 * \param longitude longitude
130 * \param altitude altitude
131 *
132 */
133 void SetLla(double latitude,double longitude,
134 float altitude);
135
136
137 /*!
138 * \brief Get east, north and up
139 *
140 * This method is mutex protected.
141 *
142 * \param east east
143 * \param north north
144 * \param up up
145 *
146 */
147 void GetEnu(float &east, float &north,
148 float &up) const;
149
150 /*!
151 * \brief Set east, north and up
152 *
153 * This method is mutex protected.
154 *
155 * \param east east
156 * \param north north
157 * \param up up
158 *
159 */
160 void SetEnu(float east, float north,
161 float up);
162
163 /*!
164 * \brief Get east and north velocities
165 *
166 * This method is mutex protected.
167 *
168 * \param eastVelocity east velocity
169 * \param northVelocity north velocity
170 *
171 */
172 void GetVelocity(float &eastVelocity, float &northVelocity) const;
173
174 /*!
175 * \brief Set east and north velocities
176 *
177 * This method is mutex protected.
178 *
179 * \param eastVelocity east velocity
180 * \param northVelocity north velocity
181 *
182 */
183 void SetVelocity(float eastVelocity, float northVelocity);
184
185 /*!
186 * \brief Get number of satellites
187 *
188 * \return number of satellites
189 *
190 */
191 uint8_t GetNumberOfSatellites(void) const;
192
193 /*!
194 * \brief Set number of satellites
195 *
196 * \param numberOfSatellites number of satellites
197 *
198 */
199 void SetNumberOfSatellites(uint8_t numberOfSatellites);
200
201 /*!
202 * \brief Get fix quality
203 *
204 * \return fix quality
205 *
206 */
207 FixQuality_t GetFixQuality(void) const;
208
209 /*!
210 * \brief Set fix quality
211 *
212 * \param fixQuality fix quality
213 *
214 */
215 void SetFixQuality(FixQuality_t fixQuality);
216
217 Type const &GetDataType() const { return dataType; }
218
219private:
220 /*!
221 * \brief Copy datas
222 *
223 * Reimplemented from io_data. \n
224 * See io_data::CopyDatas.
225 *
226 * \param dst destination buffer
227 */
228 void CopyDatas(char *dst) const;
229
230 void Queue(char **dst, const void *src, size_t size) const;
231 Type dataType;
232 double latitude,longitude;
233 float altitude;
234 uint8_t numberOfSatellites;
235 FixQuality_t fixQuality;
236 float east,north,up,eastVelocity,northVelocity;
237};
238
239} // end namespace core
240} // end namespace flair
241
242#endif // GPSDATA_H
Note: See TracBrowser for help on using the repository browser.