source: flair-src/trunk/lib/FlairSensorActuator/src/NmeaGps.h@ 340

Last change on this file since 340 was 340, checked in by Sanahuja Guillaume, 2 years ago

add servos

File size: 3.6 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 NmeaGps.h
7 * \brief Base class for GPS using NMEA sentances
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2013/08/23
10 * \version 4.0
11 */
12
13#ifndef NMEAGPS_H
14#define NMEAGPS_H
15
16#include <IODevice.h>
17#include <Vector3D.h>
18#include <nmea/nmea.h>
19
20namespace flair {
21 namespace core {
22 class FrameworkManager;
23 class GeoCoordinate;
24 class GpsData;
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 class GroupBox;
35 }
36}
37
38namespace flair {
39namespace sensor {
40
41/*! \class NmeaGps
42*
43* \brief Base class for GPS using NMEA sentances
44*/
45class NmeaGps : public core::IODevice {
46public:
47 /*!
48 \enum NMEAFlags_t
49 \brief NMEA flags
50 */
51 enum NMEAFlags_t {
52 GGA = 0x01, /*!< GGA */
53 VTG = 0x02, /*!< VTG */
54 GST = 0x04, /*!< GST */
55 GSA = 0x08, /*!< GSA */
56 };
57
58 /*!
59 * \brief Constructor
60 *
61 * Construct a NmeaGps.
62 * It will be child of the FrameworkManager.
63 *
64 * \param name name
65 * \param NMEAFlags NMEA sentances to enable
66 */
67 NmeaGps(std::string name,
68 NMEAFlags_t NMEAFlags);
69
70 /*!
71 * \brief Destructor
72 *
73 */
74 ~NmeaGps();
75
76 /*!
77 * \brief Get GPS datas
78 *
79 * \return GpsData
80 */
81 const core::GpsData *GetDatas(void) const;
82
83 /*!
84 * \brief Use default plot
85 *
86 */
87 void UseDefaultPlot(void);
88
89 /*!
90 * \brief East plot
91 *
92 * \return east plot
93 */
94 gui::DataPlot1D *EPlot(void) const;
95
96 /*!
97 * \brief North plot
98 *
99 * \return north plot
100 */
101 gui::DataPlot1D *NPlot(void) const;
102
103 /*!
104 * \brief Up plot
105 *
106 * \return up plot
107 */
108 gui::DataPlot1D *UPlot(void) const;
109
110 /*!
111 * \brief East velocity plot
112 *
113 * \return east velocity plot
114 */
115 gui::DataPlot1D *VEPlot(void) const;
116
117 /*!
118 * \brief North velocity plot
119 *
120 * \return north velocity plot
121 */
122 gui::DataPlot1D *VNPlot(void) const;
123
124 /*!
125 * \brief Main tab
126 *
127 * \return main tab
128 */
129 gui::TabWidget *GetTab(void) const;
130
131 /*!
132 * \brief Setup Layout
133 *
134 * \return setup Layout
135 */
136 gui::Layout *GetLayout(void) const;
137
138 /*!
139 * \brief Plot tab
140 *
141 * \return plot Tab
142 */
143 gui::Tab *GetPlotTab(void) const;
144
145 /*!
146 * \brief Set reference for ENU coordinates
147 *
148 * The actual position is used as reference to calculate
149 * ENU coordinates.
150 *
151 * \return fix quality
152 */
153 void SetRef(void);
154
155protected:
156 /*!
157 * \brief Parse a NMEA frame
158 *
159 * This function must be called by the reimplemented class. \n
160 * When a frame is parsed, GPS datas are filled.
161 *
162 * \param frame NMEA frame
163 * \param frame_size frame size
164 *
165 */
166 void parseFrame(const char *frame, int frame_size);
167
168 NMEAFlags_t NMEAFlags;
169
170 /*!
171 * \brief Get GPS datas
172 *
173 * \param gpsData GPS datas
174 */
175 void GetDatas(core::GpsData **gpsData) const;
176
177 /*!
178 * \brief Setup GroupBox
179 *
180 * \return setup GroupBox
181 */
182 gui::GroupBox *GetGroupBox(void) const;
183
184private:
185 gui::Tab *mainTab, *sensorTab;
186 gui::TabWidget *tab;
187 gui::GroupBox *setupGroupbox;
188 gui::PushButton *buttonRef;
189 gui::DataPlot1D *ePlot;
190 gui::DataPlot1D *nPlot;
191 gui::DataPlot1D *uPlot;
192 gui::DataPlot1D *vePlot;
193 gui::DataPlot1D *vnPlot;
194 gui::Tab *plotTab;
195 gui::Map *map;
196 gui::Label *nbSatLabel, *fixLabel;
197 core::GeoCoordinate *position;
198 bool takeRef;
199 nmeaINFO info;
200 nmeaPARSER parser;
201 nmeaGPGGA pack;
202 nmeaPOS pos;
203 double latRef, longRef, altRef;
204 core::GpsData* gpsData;
205};
206} // end namespace sensor
207} // end namespace flair
208#endif // NMEAGPS_H
Note: See TracBrowser for help on using the repository browser.