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 
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  */
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 
84  mrpt::obs::CObservationIMUPtr m_observationGyro;
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  */
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) */
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 
mrpt::hwdrivers::INCREMENTAL_ANGLE
@ INCREMENTAL_ANGLE
Definition: CGyroKVHDSP3000.h:24
mrpt::hwdrivers::CGyroKVHDSP3000::m_serialPort
CSerialPort * m_serialPort
The serial port connection.
Definition: CGyroKVHDSP3000.h:80
mrpt::hwdrivers::CGyroKVHDSP3000::m_sensorPose
mrpt::poses::CPose3D m_sensorPose
Definition: CGyroKVHDSP3000.h:74
mrpt::hwdrivers::CGyroKVHDSP3000::initialize
void initialize()
Turns on the KVH DSP 3000 device and configure it for getting orientation data.
CSerialPort.h
mrpt::hwdrivers::CGyroKVHDSP3000::loadConfig_sensorSpecific
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
mrpt::hwdrivers::INTEGRATED_ANGLE
@ INTEGRATED_ANGLE
Definition: CGyroKVHDSP3000.h:24
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:71
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:17
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:251
mrpt::hwdrivers::CGyroKVHDSP3000::m_mode
GYRO_MODE m_mode
Definition: CGyroKVHDSP3000.h:81
mrpt::utils::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: CConfigFileBase.h:31
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
CGenericSensor.h
mrpt::hwdrivers::CGyroKVHDSP3000::~CGyroKVHDSP3000
virtual ~CGyroKVHDSP3000()
Destructor.
mrpt::hwdrivers::CGyroKVHDSP3000::resetIncrementalAngle
void resetIncrementalAngle(void)
Send to the sensor the command 'Z' wich reset the integrated angle.
mrpt::hwdrivers::RATE
@ RATE
Definition: CGyroKVHDSP3000.h:24
mrpt::hwdrivers::CGyroKVHDSP3000::m_com_port
std::string m_com_port
Definition: CGyroKVHDSP3000.h:72
mrpt::hwdrivers::CSerialPort
A communications serial port built as an implementation of a utils::CStream.
Definition: CSerialPort.h:44
mrpt::hwdrivers::CGyroKVHDSP3000::CGyroKVHDSP3000
CGyroKVHDSP3000()
Constructor.
mrpt::hwdrivers::CGenericSensor
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
Definition: CGenericSensor.h:64
mrpt::hwdrivers::CGyroKVHDSP3000::changeMode
void changeMode(GYRO_MODE _newMode)
CPose3D.h
mrpt::hwdrivers::CGyroKVHDSP3000::doProcess
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
CObservationIMU.h
mrpt::hwdrivers::GYRO_MODE
GYRO_MODE
Definition: CGyroKVHDSP3000.h:24
mrpt::hwdrivers::CGyroKVHDSP3000::m_firstInteration
bool m_firstInteration
Definition: CGyroKVHDSP3000.h:82
mrpt::hwdrivers::CGyroKVHDSP3000::searchPortAndConnect
bool searchPortAndConnect()
Search the port where the sensor is located and connect to it.
mrpt::hwdrivers::CGyroKVHDSP3000::m_observationGyro
mrpt::obs::CObservationIMUPtr m_observationGyro
Definition: CGyroKVHDSP3000.h:84
mrpt::hwdrivers::CGyroKVHDSP3000
A class for interfacing KVH DSP 3000 gyroscope with an assynchronous serial communication (product SN...
Definition: CGyroKVHDSP3000.h:64
HWDRIVERS_IMPEXP
#define HWDRIVERS_IMPEXP
Definition: hwdrivers_impexp.h:82



Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020