Main MRPT website > C++ reference for MRPT 1.4.0
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-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
10#ifndef CGyroKVHDSP3000_H
11#define CGyroKVHDSP3000_H
12
13
16
17#include <mrpt/poses/CPose3D.h>
19
20namespace 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 */
72 std::string m_com_port;
73
75
76 /** Search the port where the sensor is located and connect to it
77 */
79
80 CSerialPort* m_serialPort; //!< The serial port connection
83
85
86 public:
87 /** Constructor
88 */
90
91 /** See the class documentation at the top for expected parameters */
93 const mrpt::utils::CConfigFileBase &configSource,
94 const std::string &iniSection );
95
96 /** Destructor
97 */
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 */
110 /** Send to the sensor the command 'Z' wich reset the integrated angle. (in both rate mode and incremental, this function has no effect) */
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
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial communication (product SN...
void initialize()
Turns on the KVH DSP 3000 device and configure it for getting orientation data.
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
void resetIncrementalAngle(void)
Send to the sensor the command 'Z' wich reset the integrated angle.
virtual ~CGyroKVHDSP3000()
Destructor.
CSerialPort * m_serialPort
The serial port connection.
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
mrpt::poses::CPose3D m_sensorPose
bool searchPortAndConnect()
Search the port where the sensor is located and connect to it.
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...
mrpt::obs::CObservationIMUPtr m_observationGyro
A communications serial port built as an implementation of a utils::CStream.
Definition: CSerialPort.h:44
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
This class allows loading and storing values and vectors of different types from a configuration text...
#define HWDRIVERS_IMPEXP
struct OBS_IMPEXP CObservationIMUPtr
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 09:54:56 UTC 2023