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-2018, 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::hwdrivers
20 {
22 {
26 };
27 /** A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial
28  *communication (product SN : 02-1222-01).
29  * It uses a serial port connection to the device. The class implements the
30  *generic sensor class.
31  * See also the application "rawlog-grabber" for a ready-to-use application to
32  *gather data from the scanner.
33  * The generated observation is a CObservationIMU, but only the yaw angular
34  *velocity and the absolute yaw position are
35  * are set in the vector CObservationIMU::rawMeasurements.
36  * The sensor process rate is imposed by hardware at 100Hz.
37  * For now, this sensor is only supported on posix system.
38  * \code
39  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
40  * -------------------------------------------------------
41  * [supplied_section_name]
42  * process_rate = 100 ; MUST be 100 Hz.
43  * pose_x=0 ; Sensor 3D position relative to the robot (meters)
44  * pose_y=0
45  * pose_z=0
46  * pose_yaw=0 ; Angles in degrees
47  * pose_pitch=0
48  * pose_roll=0
49  * sensorLabel = <label> ; Label of the sensor
50  * COM_port_LIN = /dev/ttyUSB0 ; COM PORT in LINUX
51  * operatingMode = <"rate"/"integrated", "incremental"> ; Default mode is
52  *Rate.
53  * \endcode
54  * In most of the communs applications, this class will be used as :
55  * \code
56  * CGyroKVHDSP3000 kvh;
57  * /// ...
58  * CConfigFile conf("conf.ini");
59  * /// ...
60  * kvh.loadConfig_sensorSpecific(conf, "KVH");
61  * /// ...
62  * while(1) {
63  * kvh.doProcess();
64  * TListObservations rateObs;
65  * kvh.getObservations(rateObs);
66  * // ....
67  * \endcode
68  * \ingroup mrpt_hwdrivers_grp
69  */
71 {
73  protected:
74  /** This serial port will be attempted to be opened automatically when this
75  * class is first used to request data from the device.
76  * \sa comms::CSerialPort
77  */
80 
82 
83  /** Search the port where the sensor is located and connect to it
84  */
85  // bool searchPortAndConnect();
86 
87  /** The serial port connection */
91 
93 
94  public:
95  /** Constructor
96  */
98 
99  /** See the class documentation at the top for expected parameters */
101  const mrpt::config::CConfigFileBase& configSource,
102  const std::string& iniSection);
103 
104  /** Destructor
105  */
106  virtual ~CGyroKVHDSP3000();
107 
108  /** This method will be invoked at a minimum rate of "process_rate" (Hz)
109  * \exception This method must throw an exception with a descriptive
110  * message if some critical error is found.
111  */
112  void doProcess();
113 
114  /** Turns on the KVH DSP 3000 device and configure it for getting
115  * orientation data. you must have called loadConfig_sensorSpecific before
116  * calling this function.
117  */
118  void initialize();
119  /** Send to the sensor the command 'Z' wich reset the integrated angle. (in
120  * both rate mode and incremental, this function has no effect) */
121  void resetIncrementalAngle(void);
122  void changeMode(GYRO_MODE _newMode);
123 
124 }; // end of class
125 
126 }
127 #endif
128 
129 
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
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:41
virtual ~CGyroKVHDSP3000()
Destructor.
Contains classes for various device interfaces.
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 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...
mrpt::poses::CPose3D m_sensorPose
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:86
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020