Main MRPT website > C++ reference for MRPT 1.5.9
CGyroKVHDSP3000.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-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 #ifndef CGyroKVHDSP3000_H
11 #define CGyroKVHDSP3000_H
12 
13 
16 
17 #include <mrpt/poses/CPose3D.h>
19 
20 namespace mrpt
21 {
22  namespace hwdrivers
23  {
25  /** A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial communication (product SN : 02-1222-01).
26  * It uses a serial port connection to the device. The class implements the generic sensor class.
27  * See also the application "rawlog-grabber" for a ready-to-use application to gather data from the scanner.
28  * The generated observation is a CObservationIMU, but only the yaw angular velocity and the absolute yaw position are
29  * are set in the vector CObservationIMU::rawMeasurements.
30  * The sensor process rate is imposed by hardware at 100Hz.
31  * For now, this sensor is only supported on posix system.
32  * \code
33  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
34  * -------------------------------------------------------
35  * [supplied_section_name]
36  * process_rate = 100 ; MUST be 100 Hz.
37  * pose_x=0 ; Sensor 3D position relative to the robot (meters)
38  * pose_y=0
39  * pose_z=0
40  * pose_yaw=0 ; Angles in degrees
41  * pose_pitch=0
42  * pose_roll=0
43  * sensorLabel = <label> ; Label of the sensor
44  * COM_port_LIN = /dev/ttyUSB0 ; COM PORT in LINUX
45  * operatingMode = <"rate"/"integrated", "incremental"> ; Default mode is Rate.
46  * \endcode
47  * In most of the communs applications, this class will be used as :
48  * \code
49  * CGyroKVHDSP3000 kvh;
50  * /// ...
51  * CConfigFile conf("conf.ini");
52  * /// ...
53  * kvh.loadConfig_sensorSpecific(conf, "KVH");
54  * /// ...
55  * while(1) {
56  * kvh.doProcess();
57  * TListObservations rateObs;
58  * kvh.getObservations(rateObs);
59  * // ....
60  * \endcode
61  * \ingroup mrpt_hwdrivers_grp
62  */
64  {
66  protected:
67 
68  /** This serial port will be attempted to be opened automatically when this class is first used to request data from the device.
69  * \sa hwdrivers::CSerialPort
70  */
73 
75 
76  /** Search the port where the sensor is located and connect to it
77  */
78  bool searchPortAndConnect();
79 
80  CSerialPort* m_serialPort; //!< The serial port connection
83 
84  mrpt::obs::CObservationIMUPtr m_observationGyro;
85 
86  public:
87  /** Constructor
88  */
89  CGyroKVHDSP3000( );
90 
91  /** See the class documentation at the top for expected parameters */
92  void loadConfig_sensorSpecific(
93  const mrpt::utils::CConfigFileBase &configSource,
94  const std::string &iniSection );
95 
96  /** Destructor
97  */
98  virtual ~CGyroKVHDSP3000();
99 
100 
101  /** This method will be invoked at a minimum rate of "process_rate" (Hz)
102  * \exception This method must throw an exception with a descriptive message if some critical error is found.
103  */
104  void doProcess();
105 
106  /** Turns on the KVH DSP 3000 device and configure it for getting orientation data. you must have called loadConfig_sensorSpecific before
107  * calling this function.
108  */
109  void initialize();
110  /** Send to the sensor the command 'Z' wich reset the integrated angle. (in both rate mode and incremental, this function has no effect) */
111  void resetIncrementalAngle(void);
112  void changeMode(GYRO_MODE _newMode);
113 
114 
115  }; // end of class
116 
117  } // end of namespace
118 } // end of namespace
119 
120 #endif
121 
122 
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
mrpt::obs::CObservationIMUPtr m_observationGyro
This class allows loading and storing values and vectors of different types from a configuration text...
GLsizei const GLchar ** string
Definition: glext.h:3919
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial communication (product SN...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::poses::CPose3D m_sensorPose
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
CSerialPort * m_serialPort
The serial port connection.
int m_COMbauds
This serial port will be attempted to be opened automatically when this class is first used to reques...



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020