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



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019