Main MRPT website > C++ reference for MRPT 1.9.9
CGPS_NTRIP.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "hwdrivers-precomp.h" // Precompiled headers
11 
14 
15 using namespace mrpt::hwdrivers;
16 using namespace mrpt::obs;
17 using namespace mrpt::system;
18 using namespace std;
19 
21 
22 /** Constructor. See mrpt::hwdrivers::CGPSInterface for the meaning of params.
23  */
24 CGPS_NTRIP::CGPS_NTRIP() : gps(), ntrip() {}
25 /** Destructor */
28 {
29  gps.initialize();
30  ntrip.initialize();
31 }
32 
33 // See docs in parent class
35 {
36  // Process GPS:
37  gps.doProcess();
38 
39  // Move sensed observations to this object:
40  {
42  gps.getObservations(lst);
43 
44  std::vector<mrpt::utils::CSerializable::Ptr> vect;
45  vect.reserve(lst.size());
46  for (TListObservations::const_iterator it = lst.begin();
47  it != lst.end(); ++it)
48  vect.push_back(it->second);
49  this->appendObservations(vect);
50  }
51 
52  // New GGA frames?
53  std::string sLastGGA = gps.getLastGGA();
54  if (!sLastGGA.empty())
55  {
56  if (m_verbose)
57  cout << "[CGPS_NTRIP] Redirecting GGA frame from GPS->NTRIP: '"
58  << sLastGGA << "'" << endl;
59 
60  ntrip.getNTRIPClient().sendBackToServer(sLastGGA + std::string("\r\n"));
61  }
62 
63  // Process NTRIP server comms:
64  ntrip.doProcess();
65 }
66 
68  const mrpt::utils::CConfigFileBase& cfg, const std::string& section)
69 {
70  // Load GPS params:
71  gps.loadConfig(mrpt::utils::CConfigFilePrefixer(cfg, "", "gps_"), section);
72  // NTRIP params:
73  ntrip.loadConfig(
74  mrpt::utils::CConfigFilePrefixer(cfg, "", "ntrip_"), section);
75 
76  // Own params:
77  // (none yet)
78 }
virtual ~CGPS_NTRIP()
Destructor.
Definition: CGPS_NTRIP.cpp:26
A wrapper for other CConfigFileBase-based objects that prefixes a given token to every key and/or sec...
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
Definition: math_frwds.h:30
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
Definition: CGPS_NTRIP.cpp:67
Contains classes for various device interfaces.
STL namespace.
const Scalar * const_iterator
Definition: eigen_plugins.h:27
virtual void initialize()
This method can or cannot be implemented in the derived class, depending on the need for it...
Definition: CGPS_NTRIP.cpp:27
std::multimap< mrpt::system::TTimeStamp, mrpt::utils::CSerializable::Ptr > TListObservations
This class allows loading and storing values and vectors of different types from a configuration text...
This namespace contains representation of robot actions and observations.
GLsizei const GLchar ** string
Definition: glext.h:4101
#define IMPLEMENTS_GENERIC_SENSOR(class_name, NameSpace)
This must be inserted in all CGenericSensor classes implementation files:
A combination of GPS receiver + NTRIP receiver capable of submitting GGA frames to enable RTCM 3...
Definition: CGPS_NTRIP.h:76
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
Definition: CGPS_NTRIP.cpp:34



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019