Main MRPT website > C++ reference for MRPT 1.4.0
CNTRIPEmitter.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2016, 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 #ifndef CNTRIPEmitter_H
10 #define CNTRIPEmitter_H
11 
15 
16 namespace mrpt
17 {
18  namespace hwdrivers
19  {
20  /** This "virtual driver" encapsulates a NTRIP client (see CNTRIPClient) but adds the functionality of dumping the received datastream to a given serial port.
21  * Used within rawlog-grabber, along CGPSInterface, this class allows to build a powerful & simple RTK-capable GPS receiver system.
22  *
23  * Therefore, this sensor will never "collect" any observation via the CGenericSensor interface.
24  *
25  * See also the example configuration file for rawlog-grabber in "share/mrpt/config_files/rawlog-grabber".
26  *
27  * \code
28  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
29  * -------------------------------------------------------
30  * [supplied_section_name]
31  * COM_port_WIN = COM1 // Serial port where the NTRIP stream will be dumped to.
32  * COM_port_LIN = ttyUSB0
33  * baudRate = 38400
34  * #transmit_to_server = true // (Default:true) Whether to send back to the TCP/IP caster all data received from the output serial port
35  *
36  * server = 143.123.9.129 // NTRIP caster IP
37  * port = 2101
38  * mountpoint = MYPOINT23
39  * //user = pepe // User & password optional.
40  * //password = loco
41  *
42  * \endcode
43  *
44  * The next picture summarizes existing MRPT classes related to GPS / GNSS devices (CGPSInterface, CNTRIPEmitter, CGPS_NTRIP):
45  *
46  * <div align=center> <img src="mrpt_gps_classes_usage.png"> </div>
47  *
48  * \ingroup mrpt_hwdrivers_grp
49  * \sa CGPSInterface, CGPS_NTRIP, CNTRIPClient
50  */
52  {
54 
55  private:
57 
58  CNTRIPClient m_client; //!< The NTRIP comms object.
59  CSerialPort m_out_COM; //!< The output serial port.
60 
61  std::string m_com_port; //!< If set to non-empty, the serial port will be attempted to be opened automatically when this class is first used to request data from the laser.
64 
65  protected:
66  /** See the class documentation at the top for expected parameters */
67  void loadConfig_sensorSpecific(
68  const mrpt::utils::CConfigFileBase &configSource,
69  const std::string &iniSection );
70 
71  public:
72  /** Constructor */
73  CNTRIPEmitter();
74 
75  /** Destructor */
76  virtual ~CNTRIPEmitter();
77 
78  /** Changes the serial port to connect to (call prior to 'doProcess'), for example "COM1" or "ttyS0".
79  * This is not needed if the configuration is loaded with "loadConfig".
80  */
81  void setOutputSerialPort(const std::string &port) { m_com_port = port; }
82 
83  /** Set up the NTRIP communications, raising an exception on fatal errors.
84  * Called automatically by rawlog-grabber.
85  * If used manually, call after "loadConfig" and before "doProcess".
86  */
87  void initialize();
88 
89  /** The main loop, which must be called in a timely fashion in order to process the incomming NTRIP data stream and dump it to the serial port.
90  * This method is called automatically when used within rawlog-grabber.
91  */
92  void doProcess();
93 
94  /** Exposes the NTRIP client object */
95  CNTRIPClient & getNTRIPClient() { return m_client; }
96  /** Exposes the NTRIP client object */
97  const CNTRIPClient & getNTRIPClient() const { return m_client; }
98 
99  }; // End of class
100 
101  } // End of namespace
102 } // End of namespace
103 
104 #endif
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
A communications serial port built as an implementation of a utils::CStream.
Definition: CSerialPort.h:43
void setOutputSerialPort(const std::string &port)
Changes the serial port to connect to (call prior to &#39;doProcess&#39;), for example "COM1" or "ttyS0"...
Definition: CNTRIPEmitter.h:81
std::string m_com_port
If set to non-empty, the serial port will be attempted to be opened automatically when this class is ...
Definition: CNTRIPEmitter.h:61
CNTRIPClient m_client
The NTRIP comms object.
Definition: CNTRIPEmitter.h:58
A client for NTRIP (HTTP) sources of differential GPS corrections from internet servers, or Global navigation satellite system (GNSS) internet radio.
Definition: CNTRIPClient.h:36
This class allows loading and storing values and vectors of different types from a configuration text...
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
CNTRIPClient::NTRIPArgs m_ntrip_args
Definition: CNTRIPEmitter.h:56
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define HWDRIVERS_IMPEXP
This "virtual driver" encapsulates a NTRIP client (see CNTRIPClient) but adds the functionality of du...
Definition: CNTRIPEmitter.h:51
The arguments for connecting to a NTRIP stream, used in CNTRIPClient::open.
Definition: CNTRIPClient.h:79
CNTRIPClient & getNTRIPClient()
Exposes the NTRIP client object.
Definition: CNTRIPEmitter.h:95
CSerialPort m_out_COM
The output serial port.
Definition: CNTRIPEmitter.h:59
const CNTRIPClient & getNTRIPClient() const
Exposes the NTRIP client object.
Definition: CNTRIPEmitter.h:97



Page generated by Doxygen 1.8.13 for MRPT 1.4.0 SVN: at Sat Sep 2 18:44:07 UTC 2017