Main MRPT website > C++ reference for MRPT 1.3.2
CBoardDLMS.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 
10 #ifndef CBoardDLMS_H
11 #define CBoardDLMS_H
12 
16 #include <mrpt/poses/CPose3D.h>
17 
18 namespace mrpt
19 {
20  namespace hwdrivers
21  {
22  /** An interface to a custom board which interfaces two SICK laser scanners.
23  * Implemented for the board v1.0 designed by 2008 @ ISA (University of Malaga).
24  *
25  * \code
26  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
27  * -------------------------------------------------------
28  * [DualLMS]
29  * driver = CBoardDLMS
30  * process_rate = 30 ; Hz
31  * USB_serialname = DLMS-001
32  *
33  * mPose_x = 0 ; Master laser range scaner 6D position on the robot (meters)
34  * mPose_y = 0
35  * mPose_z = 0
36  * mPose_yaw = 0
37  * mPose_pitch = 0
38  * mPose_roll = 0
39  *
40  * sPose_x = 0 ; Slave laser range scaner 6D position on the robot (meters)
41  * sPose_y = 0
42  * sPose_z = 0
43  * sPose_yaw = 0
44  * sPose_pitch = 0
45  * sPose_roll = 0
46  * \endcode
47  *
48  * \ingroup mrpt_hwdrivers_grp
49  */
51  {
53  protected:
54  /** A copy of the device serial number (to open the USB FTDI chip)
55  */
56  std::string m_usbSerialNumber;
57  uint32_t m_timeStartUI;
59 
61 
62  /** Tries to connect to the USB device (if disconnected).
63  * \return True on connection OK, false on error.
64  */
65  bool checkConnectionAndConnect();
66 
67  bool checkCRC( const std::vector<unsigned char> &frame );
68 
69  /** See the class documentation at the top for expected parameters */
70  void loadConfig_sensorSpecific(
71  const mrpt::utils::CConfigFileBase &configSource,
72  const std::string &iniSection );
73 
74  public:
75  /** Constructor
76  * \param serialNumberUSBdevice The serial number (text) of the device to open.
77  * The constructor will try to open the device. You can check if it failed calling "isOpen()".
78  */
79  CBoardDLMS( );
80 
81  /** Destructor
82  */
83  virtual ~CBoardDLMS();
84 
85  // See docs in parent class
86  void doProcess();
87 
88  /** This method can or cannot be implemented in the derived class, depending on the need for it.
89  * \exception This method must throw an exception with a descriptive message if some critical error is found.
90  */
91  virtual void initialize();
92 
93  /** Query the firmware version on the device (can be used to test communications).
94  * \return true on success, false on communications errors or device not found.
95  */
96  bool queryFirmwareVersion( std::string &out_firmwareVersion );
97 
98  /** Send a command to the DLMS Board
99  * \return true on success, false on communications errors or device not found.
100  */
101  bool sendCommand( uint8_t command, std::vector<unsigned char> &response );
102 
103  bool queryTimeStamp( mrpt::system::TTimeStamp &tstamp );
104 
105  }; // end of class
106 
107  } // end of namespace
108 } // End of namespace
109 
110 #endif
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:30
mrpt::poses::CPose3D m_sSensorPose
Definition: CBoardDLMS.h:60
mrpt::system::TTimeStamp m_timeStartTT
Definition: CBoardDLMS.h:58
This class allows loading and storing values and vectors of different types from a configuration text...
std::string m_usbSerialNumber
A copy of the device serial number (to open the USB FTDI chip)
Definition: CBoardDLMS.h:56
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
#define HWDRIVERS_IMPEXP
A definition of a CStream actually representing a USB connection to a FTDI chip.
An interface to a custom board which interfaces two SICK laser scanners.
Definition: CBoardDLMS.h:50



Page generated by Doxygen 1.8.12 for MRPT 1.3.2 SVN: at Thu Nov 10 13:46:27 UTC 2016