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-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
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::config::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
mrpt::hwdrivers::INCREMENTAL_ANGLE
@ INCREMENTAL_ANGLE
Definition: CGyroKVHDSP3000.h:26
mrpt::hwdrivers::CGyroKVHDSP3000::doProcess
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
Definition: CGyroKVHDSP3000.cpp:52
mrpt::hwdrivers::CGyroKVHDSP3000::m_sensorPose
mrpt::poses::CPose3D m_sensorPose
Definition: CGyroKVHDSP3000.h:83
CSerialPort.h
mrpt::hwdrivers::CGyroKVHDSP3000::m_serialPort
mrpt::comms::CSerialPort * m_serialPort
Search the port where the sensor is located and connect to it.
Definition: CGyroKVHDSP3000.h:90
mrpt::comms::CSerialPort
A communications serial port built as an implementation of a utils::CStream.
Definition: CSerialPort.h:43
mrpt::hwdrivers::INTEGRATED_ANGLE
@ INTEGRATED_ANGLE
Definition: CGyroKVHDSP3000.h:27
mrpt::hwdrivers::CGyroKVHDSP3000::m_COMbauds
int m_COMbauds
This serial port will be attempted to be opened automatically when this class is first used to reques...
Definition: CGyroKVHDSP3000.h:80
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
DEFINE_GENERIC_SENSOR
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
Definition: CGenericSensor.h:314
mrpt::hwdrivers::CGyroKVHDSP3000::m_mode
GYRO_MODE m_mode
Definition: CGyroKVHDSP3000.h:91
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::obs::CObservationIMU::Ptr
std::shared_ptr< CObservationIMU > Ptr
Definition: CObservationIMU.h:110
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
CGenericSensor.h
mrpt::hwdrivers::RATE
@ RATE
Definition: CGyroKVHDSP3000.h:25
mrpt::hwdrivers::CGyroKVHDSP3000::CGyroKVHDSP3000
CGyroKVHDSP3000()
Constructor.
Definition: CGyroKVHDSP3000.cpp:28
mrpt::hwdrivers::CGyroKVHDSP3000::m_com_port
std::string m_com_port
Definition: CGyroKVHDSP3000.h:81
mrpt::hwdrivers::CGyroKVHDSP3000::changeMode
void changeMode(GYRO_MODE _newMode)
Definition: CGyroKVHDSP3000.cpp:156
mrpt::hwdrivers::CGenericSensor
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
Definition: CGenericSensor.h:70
CObservationIMU.h
CPose3D.h
mrpt::hwdrivers::GYRO_MODE
GYRO_MODE
Definition: CGyroKVHDSP3000.h:23
mrpt::hwdrivers::CGyroKVHDSP3000::m_firstInteration
bool m_firstInteration
Definition: CGyroKVHDSP3000.h:92
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::hwdrivers::CGyroKVHDSP3000
A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial communication (product SN...
Definition: CGyroKVHDSP3000.h:72
mrpt::hwdrivers::CGyroKVHDSP3000::~CGyroKVHDSP3000
virtual ~CGyroKVHDSP3000()
Destructor.
Definition: CGyroKVHDSP3000.cpp:43
mrpt::hwdrivers::CGyroKVHDSP3000::initialize
void initialize()
Turns on the KVH DSP 3000 device and configure it for getting orientation data.
Definition: CGyroKVHDSP3000.cpp:101
mrpt::hwdrivers::CGyroKVHDSP3000::loadConfig_sensorSpecific
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
Definition: CGyroKVHDSP3000.cpp:123
mrpt::hwdrivers::CGyroKVHDSP3000::resetIncrementalAngle
void resetIncrementalAngle(void)
Send to the sensor the command 'Z' wich reset the integrated angle.
Definition: CGyroKVHDSP3000.cpp:182
mrpt::hwdrivers::CGyroKVHDSP3000::m_observationGyro
mrpt::obs::CObservationIMU::Ptr m_observationGyro
Definition: CGyroKVHDSP3000.h:94



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST