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-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
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  */
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 config::CConfigFileBase
63  * and
64  * derived classes)
65  * See hwdrivers::CSonarSRF10 for the possible parameters
66  */
68  const mrpt::config::CConfigFileBase* configSource,
69  const std::string& iniSection);
70 
71  public:
72  /** Constructor
73  */
75 
76  /** Destructor
77  */
79  /** Changes the serial number of the device to open
80  */
81  void setDeviceSerialNumber(const std::string& deviceSerialNumber)
82  {
83  m_serialNumber = deviceSerialNumber;
84  }
85 
86  /** Read the gain for the amplifier of the ear "channel", where channel is
87  * 0, 1 or 2.
88  */
89  void GetGain(int& _gain, int& channel);
90 
91  /** Set the gain for the amplifier each ear. The value range is [0x00(min)
92  * .. 0x7F(max)]. The value 0x80 set the resistor
93  * in high impedance state, DON'T USE IT!!!
94  */
95  bool SetGain(int& new_gain, int& channel);
96 
97  /** This function return the angle where last sound where detected. This
98  * angle is related to the robot pose, NOT head pose.
99  * \code
100  * angle > 0deg --> Sound detected in the left
101  * angle = 0deg --> Sound detected in front of the head
102  * angle < 0deg --> Sound detected in the right
103  * \endcode
104  */
105  void GetSoundLocation(int& ang);
106 
107  /** Debug only!!! This function return the last 500 acquired samples for
108  * each sound channel.
109  *
110  */
112 
113  /** Move the head in:
114  \code
115  * elevation = 'yaw' degrees
116  * orientation = 'pitch' degrees
117  * \endcode
118  */
119  void SetHeadPose(int& yaw, int& pitch);
120 
121 }; // End of class
122 
123 } // End of namespace
124 } // end of namespace
125 
126 #endif
mrpt::hwdrivers::CRoboticHeadInterface::head_pitch
int head_pitch
Definition: CRoboticHeadInterface.h:55
mrpt::hwdrivers::CRoboticHeadInterface::GetSoundLocation
void GetSoundLocation(int &ang)
This function return the angle where last sound where detected.
Definition: CRoboticHeadInterface.cpp:91
mrpt::math::CMatrixTemplate
This template class provides the basic functionality for a general 2D any-size, resizable container o...
Definition: CMatrixTemplate.h:72
mrpt::hwdrivers::CRoboticHeadInterface::m_usbConnection
mrpt::comms::CInterfaceFTDI m_usbConnection
Definition: CRoboticHeadInterface.h:51
mrpt::hwdrivers::CRoboticHeadInterface::loadConfig_sensorSpecific
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,...
Definition: CRoboticHeadInterface.cpp:41
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::hwdrivers::CRoboticHeadInterface::~CRoboticHeadInterface
~CRoboticHeadInterface()
Destructor.
Definition: CRoboticHeadInterface.h:78
mrpt::hwdrivers::CRoboticHeadInterface::gain
std::vector< int32_t > gain
Definition: CRoboticHeadInterface.h:54
mrpt::hwdrivers::CRoboticHeadInterface::msg
mrpt::serialization::CMessage msg
Definition: CRoboticHeadInterface.h:52
mrpt::serialization::CMessage
A class that contain generic messages, that can be sent and received from a "CClientTCPSocket" object...
Definition: CMessage.h:29
CConfigFileBase.h
mrpt::hwdrivers::CRoboticHeadInterface::SetGain
bool SetGain(int &new_gain, int &channel)
Set the gain for the amplifier each ear.
Definition: CRoboticHeadInterface.cpp:73
COutputLogger.h
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::comms::CInterfaceFTDI
A definition of a CStream actually representing a USB connection to a FTDI chip.
Definition: CInterfaceFTDI.h:75
CInterfaceFTDI.h
mrpt::hwdrivers::CRoboticHeadInterface::Get3SoundBuffer
void Get3SoundBuffer(mrpt::math::CMatrixTemplate< int > &buf)
Debug only!!! This function return the last 500 acquired samples for each sound channel.
Definition: CRoboticHeadInterface.cpp:104
mrpt::hwdrivers::CRoboticHeadInterface
This "software driver" implements the communication protocol for interfacing a Robotic Head Board thr...
Definition: CRoboticHeadInterface.h:48
mrpt::obs::gnss::pitch
double pitch
Definition: gnss_messages_novatel.h:264
mrpt::hwdrivers::CRoboticHeadInterface::CRoboticHeadInterface
CRoboticHeadInterface()
Constructor.
Definition: CRoboticHeadInterface.cpp:22
mrpt::hwdrivers::CRoboticHeadInterface::head_yaw
int head_yaw
Definition: CRoboticHeadInterface.h:55
mrpt::hwdrivers::CRoboticHeadInterface::GetGain
void GetGain(int &_gain, int &channel)
Read the gain for the amplifier of the ear "channel", where channel is 0, 1 or 2.
Definition: CRoboticHeadInterface.cpp:56
mrpt::system::COutputLogger
Versatile class for consistent logging and management of output messages.
Definition: system/COutputLogger.h:117
mrpt::hwdrivers::CRoboticHeadInterface::SetHeadPose
void SetHeadPose(int &yaw, int &pitch)
Move the head in:
CObservationRange.h
mrpt::hwdrivers::CRoboticHeadInterface::setDeviceSerialNumber
void setDeviceSerialNumber(const std::string &deviceSerialNumber)
Changes the serial number of the device to open.
Definition: CRoboticHeadInterface.h:81
string
GLsizei const GLchar ** string
Definition: glext.h:4101
CMatrixTemplate.h
mrpt::hwdrivers::CRoboticHeadInterface::m_serialNumber
std::string m_serialNumber
Definition: CRoboticHeadInterface.h:53
CMessage.h



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