Main MRPT website > C++ reference for MRPT 1.9.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 
14 #include <mrpt/comms/CSerialPort.h>
15 
16 #include <mrpt/poses/CPose3D.h>
18 
19 namespace mrpt
20 {
21 namespace hwdrivers
22 {
24 {
28 };
29 /** A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial
30  *communication (product SN : 02-1222-01).
31  * It uses a serial port connection to the device. The class implements the
32  *generic sensor class.
33  * See also the application "rawlog-grabber" for a ready-to-use application to
34  *gather data from the scanner.
35  * The generated observation is a CObservationIMU, but only the yaw angular
36  *velocity and the absolute yaw position are
37  * are set in the vector CObservationIMU::rawMeasurements.
38  * The sensor process rate is imposed by hardware at 100Hz.
39  * For now, this sensor is only supported on posix system.
40  * \code
41  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
42  * -------------------------------------------------------
43  * [supplied_section_name]
44  * process_rate = 100 ; MUST be 100 Hz.
45  * pose_x=0 ; Sensor 3D position relative to the robot (meters)
46  * pose_y=0
47  * pose_z=0
48  * pose_yaw=0 ; Angles in degrees
49  * pose_pitch=0
50  * pose_roll=0
51  * sensorLabel = <label> ; Label of the sensor
52  * COM_port_LIN = /dev/ttyUSB0 ; COM PORT in LINUX
53  * operatingMode = <"rate"/"integrated", "incremental"> ; Default mode is
54  *Rate.
55  * \endcode
56  * In most of the communs applications, this class will be used as :
57  * \code
58  * CGyroKVHDSP3000 kvh;
59  * /// ...
60  * CConfigFile conf("conf.ini");
61  * /// ...
62  * kvh.loadConfig_sensorSpecific(conf, "KVH");
63  * /// ...
64  * while(1) {
65  * kvh.doProcess();
66  * TListObservations rateObs;
67  * kvh.getObservations(rateObs);
68  * // ....
69  * \endcode
70  * \ingroup mrpt_hwdrivers_grp
71  */
73 {
75  protected:
76  /** This serial port will be attempted to be opened automatically when this
77  * class is first used to request data from the device.
78  * \sa comms::CSerialPort
79  */
82 
84 
85  /** Search the port where the sensor is located and connect to it
86  */
87  // bool searchPortAndConnect();
88 
89  /** The serial port connection */
93 
95 
96  public:
97  /** Constructor
98  */
100 
101  /** See the class documentation at the top for expected parameters */
103  const mrpt::utils::CConfigFileBase& configSource,
104  const std::string& iniSection);
105 
106  /** Destructor
107  */
108  virtual ~CGyroKVHDSP3000();
109 
110  /** This method will be invoked at a minimum rate of "process_rate" (Hz)
111  * \exception This method must throw an exception with a descriptive
112  * message if some critical error is found.
113  */
114  void doProcess();
115 
116  /** Turns on the KVH DSP 3000 device and configure it for getting
117  * orientation data. you must have called loadConfig_sensorSpecific before
118  * calling this function.
119  */
120  void initialize();
121  /** Send to the sensor the command 'Z' wich reset the integrated angle. (in
122  * both rate mode and incremental, this function has no effect) */
123  void resetIncrementalAngle(void);
124  void changeMode(GYRO_MODE _newMode);
125 
126 }; // end of class
127 
128 } // end of namespace
129 } // end of namespace
130 
131 #endif
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
std::shared_ptr< CObservationIMU > Ptr
mrpt::comms::CSerialPort * m_serialPort
Search the port where the sensor is located and connect to it.
A communications serial port built as an implementation of a utils::CStream.
Definition: CSerialPort.h:47
virtual ~CGyroKVHDSP3000()
Destructor.
mrpt::obs::CObservationIMU::Ptr m_observationGyro
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
This class allows loading and storing values and vectors of different types from a configuration text...
void initialize()
Turns on the KVH DSP 3000 device and configure it for getting orientation data.
GLsizei const GLchar ** string
Definition: glext.h:4101
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
void resetIncrementalAngle(void)
Send to the sensor the command &#39;Z&#39; wich reset the integrated angle.
#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:88
void changeMode(GYRO_MODE _newMode)
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.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019