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



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