Main MRPT website > C++ reference for MRPT 1.3.2
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-2015, 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  *
35  * server = 143.123.9.129 // NTRIP caster IP
36  * port = 2101
37  * mountpoint = MYPOINT23
38  * //user = pepe // User & password optional.
39  * //password = loco
40  *
41  * \endcode
42  *
43  * \ingroup mrpt_hwdrivers_grp
44  * \sa CGPSInterface, CNTRIPClient
45  */
47  {
49 
50  private:
52 
53  CNTRIPClient m_client; //!< The NTRIP comms object.
54  CSerialPort m_out_COM; //!< The output serial port.
55 
56  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.
58 
59  protected:
60  /** See the class documentation at the top for expected parameters */
61  void loadConfig_sensorSpecific(
62  const mrpt::utils::CConfigFileBase &configSource,
63  const std::string &iniSection );
64 
65  public:
66  /** Constructor */
67  CNTRIPEmitter();
68 
69  /** Destructor */
70  virtual ~CNTRIPEmitter();
71 
72  /** Changes the serial port to connect to (call prior to 'doProcess'), for example "COM1" or "ttyS0".
73  * This is not needed if the configuration is loaded with "loadConfig".
74  */
75  void setOutputSerialPort(const std::string &port) { m_com_port = port; }
76 
77  /** Set up the NTRIP communications, raising an exception on fatal errors.
78  * Called automatically by rawlog-grabber.
79  * If used manually, call after "loadConfig" and before "doProcess".
80  */
81  void initialize();
82 
83  /** 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.
84  * This method is called automatically when used within rawlog-grabber.
85  */
86  void doProcess();
87 
88  /** Exposes the NTRIP client object */
89  CNTRIPClient & getNTRIPClient() { return m_client; }
90  /** Exposes the NTRIP client object */
91  const CNTRIPClient & getNTRIPClient() const { return m_client; }
92 
93  }; // End of class
94 
95  } // End of namespace
96 } // End of namespace
97 
98 #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 'doProcess'), for example "COM1" or "ttyS0"...
Definition: CNTRIPEmitter.h:75
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:56
const CNTRIPClient & getNTRIPClient() const
Exposes the NTRIP client object.
Definition: CNTRIPEmitter.h:91
CNTRIPClient m_client
The NTRIP comms object.
Definition: CNTRIPEmitter.h:53
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:51
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:46
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:89
CSerialPort m_out_COM
The output serial port.
Definition: CNTRIPEmitter.h:54



Page generated by Doxygen 1.8.9.1 for MRPT 1.3.2 SVN:Unversioned directory at Thu Dec 10 00:07:55 UTC 2015