Flair
Framework Libre Air
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties
Gps.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}
13 #ifndef GPS_H
14 #define GPS_H
15 
16 #include <IODevice.h>
17 #include <nmea/nmea.h>
18 
19 namespace flair {
20 namespace core {
21 class cvmatrix;
22 class FrameworkManager;
23 class GeoCoordinate;
24 class Vector3D;
25 }
26 namespace gui {
27 class Layout;
28 class DataPlot1D;
29 class Tab;
30 class TabWidget;
31 class PushButton;
32 class Map;
33 class Label;
34 }
35 }
36 
37 namespace flair {
38 namespace sensor {
43 class Gps : public core::IODevice {
44 public:
49  enum class FixQuality_t {
50  Invalid = 0,
51  Gps = 1,
52  DGps = 2,
53  Pps = 3,
54  Rtk = 4,
55  RtkFloat = 5,
56  Estimated = 6,
57  Manual = 7,
58  Simulation = 8,
59  };
60 
65  enum NMEAFlags_t {
66  GGA = 0x01,
67  VTG = 0x02,
68  GST = 0x04,
69  };
70 
80  Gps(const core::FrameworkManager *parent, std::string name,
81  NMEAFlags_t NMEAFlags);
82 
87  ~Gps();
88 
93  void UseDefaultPlot(void);
94 
100  gui::DataPlot1D *EPlot(void) const;
101 
107  gui::DataPlot1D *NPlot(void) const;
108 
114  gui::DataPlot1D *UPlot(void) const;
115 
121  gui::DataPlot1D *VEPlot(void) const;
122 
128  gui::DataPlot1D *VNPlot(void) const;
129 
135  gui::TabWidget *GetTab(void) const;
136 
142  gui::Layout *GetLayout(void) const;
143 
149  gui::Tab *GetPlotTab(void) const;
150 
156  uint16_t NbSat(void) const;
157 
163  FixQuality_t FixQuality(void) const;
164 
173  void SetRef(void);
174 
180  void GetENUPosition(core::Vector3D *point);
181 
182 protected:
193  void parseFrame(const char *frame, int frame_size);
194 
195  NMEAFlags_t NMEAFlags;
196 
197 protected:
198  core::GeoCoordinate *position;
199 
200 private:
208  void UpdateFrom(const core::io_data *data){};
209 
210  gui::Tab *main_tab, *sensor_tab;
211  gui::TabWidget *tab;
212  gui::PushButton *button_ref;
213  gui::DataPlot1D *e_plot;
214  gui::DataPlot1D *n_plot;
215  gui::DataPlot1D *u_plot;
216  gui::DataPlot1D *ve_plot;
217  gui::DataPlot1D *vn_plot;
218  gui::Tab *plot_tab;
219  gui::Map *map;
220  gui::Label *nb_sat_label, *fix_label;
221  uint16_t nb_sat;
222  FixQuality_t fix;
223  bool take_ref;
224  nmeaINFO info;
225  nmeaPARSER parser;
226  nmeaGPGGA pack;
227  nmeaPOS pos;
228  double lat_ref, long_ref, alt_ref;
229 
230  // matrix
231  core::cvmatrix *output;
232 };
233 } // end namespace sensor
234 } // end namespace framewor
235 #endif // GPS_H
Abstract class for data types.
Definition: io_data.h:77
gui::DataPlot1D * VNPlot(void) const
North velocity plot.
gui::DataPlot1D * VEPlot(void) const
East velocity plot.
Abstract class for input/ouput system.
Definition: IODevice.h:44
Base class for GPS.
Definition: Gps.h:43
Class defining a matrix of kind CvMat.
Definition: cvmatrix.h:33
Class defining a 3D vector.
Definition: Vector3D.h:28
Definition: Gps.h:67
void parseFrame(const char *frame, int frame_size)
Parse a NMEA frame.
Abstract class for input/ouput system.
gui::DataPlot1D * EPlot(void) const
East plot.
gui::Layout * GetLayout(void) const
Setup Layout.
Class displaying a QPushButton on the ground station.
Definition: PushButton.h:28
gui::DataPlot1D * NPlot(void) const
North plot.
FixQuality_t FixQuality(void) const
Fix Quality.
Class displaying a QLabel on the ground station.
Definition: Label.h:28
Abstract class to display a layout on the ground station.
Definition: Layout.h:33
Main class of the Framework library.
Definition: FrameworkManager.h:45
uint16_t NbSat(void) const
Number of used satellites.
Class displaying a QTabWidget on the ground station.
Definition: TabWidget.h:29
Definition: Gps.h:66
Class displaying a GPS map on the ground station.
Definition: Map.h:33
FixQuality_t
Fix qualty indicators.
Definition: Gps.h:49
Definition: Gps.h:68
gui::Tab * GetPlotTab(void) const
Plot tab.
NMEAFlags_t
NMEA flags.
Definition: Gps.h:65
void UseDefaultPlot(void)
Use default plot.
void SetRef(void)
Set reference for ENU coordinates.
Class defining a point by its lla coordinates.
Definition: GeoCoordinate.h:24
gui::DataPlot1D * UPlot(void) const
Up plot.
~Gps()
Destructor.
gui::TabWidget * GetTab(void) const
Main tab.
void GetENUPosition(core::Vector3D *point)
Get ENU position.
Gps(const core::FrameworkManager *parent, std::string name, NMEAFlags_t NMEAFlags)
Constructor.
Class displaying a 1D plot on the ground station.
Definition: DataPlot1D.h:33
Class displaying a QTab on the ground station.
Definition: Tab.h:29