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-2018, 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 #include <iostream>
15 
16 using namespace mrpt::hwdrivers;
17 using namespace mrpt::obs;
18 using namespace mrpt::system;
19 using namespace std;
20 
22 
23 /** Constructor. See mrpt::hwdrivers::CGPSInterface for the meaning of params.
24  */
25 CGPS_NTRIP::CGPS_NTRIP() : gps(), ntrip() {}
26 /** Destructor */
29 {
30  gps.initialize();
31  ntrip.initialize();
32 }
33 
34 // See docs in parent class
36 {
37  // Process GPS:
38  gps.doProcess();
39 
40  // Move sensed observations to this object:
41  {
43  gps.getObservations(lst);
44 
45  std::vector<mrpt::serialization::CSerializable::Ptr> vect;
46  vect.reserve(lst.size());
47  for (TListObservations::const_iterator it = lst.begin();
48  it != lst.end(); ++it)
49  vect.push_back(it->second);
50  this->appendObservations(vect);
51  }
52 
53  // New GGA frames?
54  std::string sLastGGA = gps.getLastGGA();
55  if (!sLastGGA.empty())
56  {
57  if (m_verbose)
58  cout << "[CGPS_NTRIP] Redirecting GGA frame from GPS->NTRIP: '"
59  << sLastGGA << "'" << endl;
60 
61  ntrip.getNTRIPClient().sendBackToServer(sLastGGA + std::string("\r\n"));
62  }
63 
64  // Process NTRIP server comms:
65  ntrip.doProcess();
66 }
67 
69  const mrpt::config::CConfigFileBase& cfg, const std::string& section)
70 {
71  // Load GPS params:
72  gps.loadConfig(mrpt::config::CConfigFilePrefixer(cfg, "", "gps_"), section);
73  // NTRIP params:
74  ntrip.loadConfig(
75  mrpt::config::CConfigFilePrefixer(cfg, "", "ntrip_"), section);
76 
77  // Own params:
78  // (none yet)
79 }
virtual ~CGPS_NTRIP()
Destructor.
Definition: CGPS_NTRIP.cpp:27
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
Definition: CGPS_NTRIP.cpp:68
Contains classes for various device interfaces.
STL namespace.
virtual void initialize()
This method can or cannot be implemented in the derived class, depending on the need for it...
Definition: CGPS_NTRIP.cpp:28
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.
A wrapper for other CConfigFileBase-based objects that prefixes a given token to every key and/or sec...
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:74
std::multimap< mrpt::system::TTimeStamp, mrpt::serialization::CSerializable::Ptr > TListObservations
const Scalar * const_iterator
Definition: eigen_plugins.h:27
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
Definition: CGPS_NTRIP.cpp:35



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020