Flair
Framework Libre Air
GpsData.h
Go to the documentation of this file.
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}
12 #ifndef GPSDATA_H
13 #define GPSDATA_H
14 
15 #include <io_data.h>
16 
17 namespace flair {
18 namespace core {
19 
20  class IODataElement;
21  class Vector3D;
22 
31 class GpsData : public io_data {
32 public:
33  class Type : public DataType {
34  public:
35  Type(void){}
36  std::string GetDescription() const { return "gps data"; }
37  size_t GetSize() const {
38  size_t size = 0;
39  size += 2*doubleType.GetSize(); // Latitude, Longitude
40  size += floatType.GetSize(); // Altitude
41  size += UInt8Type.GetSize(); // NumberOfSatellites
42  size += UInt8Type.GetSize(); // FixQuality_t
43  size += 5*floatType.GetSize();//e,n,u,ve,vn
44  return size;
45  }
46 
47  private:
48  };
49 
54  typedef enum {
60  East ,
62  Up ,
66 
71  enum class FixQuality_t : uint8_t {
72  Invalid = 0,
73  Gps = 1,
74  DGps = 2,
75  Pps = 3,
76  Rtk = 4,
77  RtkFloat = 5,
78  Estimated = 6,
79  Manual = 7,
80  Simulation = 8,
81  };
82 
92  GpsData(const Object *parent, std::string name = "", int n = 1);
93 
98  ~GpsData();
99 
109  IODataElement *Element(PlotableData_t data_type) const;
110 
121  void GetLla(double &latitude, double &longitude,
122  float &altitude) const;
123 
134  void SetLla(double latitude,double longitude,
135  float altitude);
136 
137 
148  void GetEnu(float &east, float &north,
149  float &up) const;
150 
161  void SetEnu(float east, float north,
162  float up);
163 
173  void GetVelocity(float &eastVelocity, float &northVelocity) const;
174 
184  void SetVelocity(float eastVelocity, float northVelocity);
185 
192  uint8_t GetNumberOfSatellites(void) const;
193 
200  void SetNumberOfSatellites(uint8_t numberOfSatellites);
201 
208  FixQuality_t GetFixQuality(void) const;
209 
216  void SetFixQuality(FixQuality_t fixQuality);
217 
218  Type const &GetDataType() const { return dataType; }
219 
220 private:
229  void CopyDatas(char *dst) const;
230 
231  void Queue(char **dst, const void *src, size_t size) const;
232  Type dataType;
233  double latitude,longitude;
234  float altitude;
235  uint8_t numberOfSatellites;
236  FixQuality_t fixQuality;
237  float east,north,up,eastVelocity,northVelocity;
238 };
239 
240 } // end namespace core
241 } // end namespace flair
242 
243 #endif // GPSDATA_H
Abstract class for data types.
Definition: io_data.h:94
~GpsData()
Destructor.
Definition: GpsData.h:60
Definition: io_data.h:26
Definition: GpsData.h:57
Base class for all Framework's classes.
Definition: Object.h:77
void GetEnu(float &east, float &north, float &up) const
Get east, north and up.
namespace of the flair Framework
Definition: Ahrs.h:19
GpsData(const Object *parent, std::string name="", int n=1)
Constructor.
Class defining gps datas.
Definition: GpsData.h:31
Definition: GpsData.h:64
Definition: GpsData.h:33
void SetNumberOfSatellites(uint8_t numberOfSatellites)
Set number of satellites.
Definition: GpsData.h:56
Abstract class for data types.
void SetEnu(float east, float north, float up)
Set east, north and up.
IODataElement * Element(PlotableData_t data_type) const
Element.
Definition: GpsData.h:61
void SetFixQuality(FixQuality_t fixQuality)
Set fix quality.
Definition: GpsData.h:59
uint8_t GetNumberOfSatellites(void) const
Get number of satellites.
PlotableData_t
Datas wich can be plotted in a DataPlot1D.
Definition: GpsData.h:54
Definition: GpsData.h:63
void GetVelocity(float &eastVelocity, float &northVelocity) const
Get east and north velocities.
Definition: GpsData.h:62
FixQuality_t
Fix qualty indicators.
Definition: GpsData.h:71
void SetLla(double latitude, double longitude, float altitude)
Set latitude, longitude and altitude.
void SetVelocity(float eastVelocity, float northVelocity)
Set east and north velocities.
Abstract class for accessing an element of an io_data.
Definition: IODataElement.h:27
Definition: GpsData.h:55
FixQuality_t GetFixQuality(void) const
Get fix quality.
void GetLla(double &latitude, double &longitude, float &altitude) const
Get latitude, longitude and altitude.