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

Last change on this file since 183 was 180, checked in by Sanahuja Guillaume, 7 years ago

modifs gps

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