Main MRPT website > C++ reference for MRPT 1.9.9
CRoboticHeadInterface.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 CRoboticHeadInterface_H
11 #define CRoboticHeadInterface_H
12 
14 #include <mrpt/utils/CMessage.h>
19 
20 namespace mrpt
21 {
22 namespace hwdrivers
23 {
24 /** This "software driver" implements the communication protocol for
25  * interfacing a Robotic Head Board through a custom
26  * USB RS-422 interface board.
27  * In this class the "bind" is ignored since it is designed for USB
28  * connections only, thus it internally generate the required object for
29  * simplicity of use.
30  * The default serial number is "OREJA001"
31  *
32  * Warning: Avoid defining an object of this class in a global scope if you
33  * want to catch all potential
34  * exceptions during the constructors (like USB interface DLL not found,
35  * etc...)
36  *
37  * \code
38  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
39  * -------------------------------------------------------
40  * [supplied_section_name]
41  * HEAD_serialNumber=OREJA001
42  * HEAD_gain=127,127,127
43  * HEAD_yaw=0 // initial yaw value
44  * HEAD_pitch=0 // initial tilt
45  * \endcode
46  * \ingroup mrpt_hwdrivers_grp
47  */
48 class CRoboticHeadInterface : public mrpt::utils::COutputLogger
49 {
50  private:
54  std::vector<int32_t> gain;
56 
57  // bool checkControllerIsConnected();
58 
59  protected:
60  /** Loads specific configuration for the device from a given source of
61  * configuration parameters, for example, an ".ini" file,
62  * loading from the section "[iniSection]" (see utils::CConfigFileBase and
63  * derived classes)
64  * See hwdrivers::CSonarSRF10 for the possible parameters
65  */
67  const mrpt::utils::CConfigFileBase* configSource,
68  const std::string& iniSection);
69 
70  public:
71  /** Constructor
72  */
74 
75  /** Destructor
76  */
78  /** Changes the serial number of the device to open
79  */
80  void setDeviceSerialNumber(const std::string& deviceSerialNumber)
81  {
82  m_serialNumber = deviceSerialNumber;
83  }
84 
85  /** Read the gain for the amplifier of the ear "channel", where channel is
86  * 0, 1 or 2.
87  */
88  void GetGain(int& _gain, int& channel);
89 
90  /** Set the gain for the amplifier each ear. The value range is [0x00(min)
91  * .. 0x7F(max)]. The value 0x80 set the resistor
92  * in high impedance state, DON'T USE IT!!!
93  */
94  bool SetGain(int& new_gain, int& channel);
95 
96  /** This function return the angle where last sound where detected. This
97  * angle is related to the robot pose, NOT head pose.
98  * \code
99  * angle > 0deg --> Sound detected in the left
100  * angle = 0deg --> Sound detected in front of the head
101  * angle < 0deg --> Sound detected in the right
102  * \endcode
103  */
104  void GetSoundLocation(int& ang);
105 
106  /** Debug only!!! This function return the last 500 acquired samples for
107  * each sound channel.
108  *
109  */
111 
112  /** Move the head in:
113  \code
114  * elevation = 'yaw' degrees
115  * orientation = 'pitch' degrees
116  * \endcode
117  */
118  void SetHeadPose(int& yaw, int& pitch);
119 
120 }; // End of class
121 
122 } // End of namespace
123 } // end of namespace
124 
125 #endif
void Get3SoundBuffer(mrpt::math::CMatrixTemplate< int > &buf)
Debug only!!! This function return the last 500 acquired samples for each sound channel.
bool SetGain(int &new_gain, int &channel)
Set the gain for the amplifier each ear.
void GetGain(int &_gain, int &channel)
Read the gain for the amplifier of the ear "channel", where channel is 0, 1 or 2. ...
void SetHeadPose(int &yaw, int &pitch)
Move the head in:
void setDeviceSerialNumber(const std::string &deviceSerialNumber)
Changes the serial number of the device to open.
This class allows loading and storing values and vectors of different types from a configuration text...
This "software driver" implements the communication protocol for interfacing a Robotic Head Board thr...
GLsizei const GLchar ** string
Definition: glext.h:4101
This template class provides the basic functionality for a general 2D any-size, resizable container o...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void GetSoundLocation(int &ang)
This function return the angle where last sound where detected.
A definition of a CStream actually representing a USB connection to a FTDI chip.
mrpt::comms::CInterfaceFTDI m_usbConnection
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase *configSource, const std::string &iniSection)
Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CSonarSRF10 for the possible parameters.
A class that contain generic messages, that can be sent and received from a "CClientTCPSocket" object...
Definition: CMessage.h:31



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