This "software driver" implements the communication protocol for interfacing a Robotic Head Board through a custom USB RS-422 interface board.
In this class the "bind" is ignored since it is designed for USB connections only, thus it internally generate the required object for simplicity of use. The default serial number is "OREJA001"
Warning: Avoid defining an object of this class in a global scope if you want to catch all potential exceptions during the constructors (like USB interface DLL not found, etc...)
PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS: ------------------------------------------------------- [supplied_section_name] HEAD_serialNumber=OREJA001 HEAD_gain=127,127,127 HEAD_yaw=0 //orientación inicial HEAD_pitch=0 //elevación inicial
Definition at line 67 of file CRoboticHeadInterface.h.
#include <mrpt/hwdrivers/CRoboticHeadInterface.h>
Public Member Functions | |
CRoboticHeadInterface () | |
Constructor. | |
~CRoboticHeadInterface () | |
Destructor. | |
void | setDeviceSerialNumber (const std::string &deviceSerialNumber) |
Changes the serial number of the device to open. | |
void | GetGain (int &_gain, int &channel) |
Read the gain for the amplifier of the ear "channel", where channel is 0, 1 or 2. | |
bool | SetGain (int &new_gain, int &channel) |
Set the gain for the amplifier each ear. | |
void | GetSoundLocation (int &ang) |
This function return the angle where last sound where detected. | |
void | Get3SoundBuffer (CMatrixTemplate< int > &buf) |
Debug only!!! This function return the last 500 acquired samples for each sound channel. | |
void | SetHeadPose (int &yaw, int &pitch) |
Move the head in: | |
Protected Member Functions | |
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. | |
Private Member Functions | |
bool | checkControllerIsConnected () |
Private Attributes | |
CInterfaceFTDIMessages | m_usbConnection |
utils::CMessage | msg |
std::string | m_serialNumber |
std::vector< int32_t > | gain |
int | head_yaw |
int | head_pitch |
mrpt::hwdrivers::CRoboticHeadInterface::CRoboticHeadInterface | ( | ) |
Constructor.
mrpt::hwdrivers::CRoboticHeadInterface::~CRoboticHeadInterface | ( | ) | [inline] |
Destructor.
Definition at line 93 of file CRoboticHeadInterface.h.
bool mrpt::hwdrivers::CRoboticHeadInterface::checkControllerIsConnected | ( | ) | [private] |
void mrpt::hwdrivers::CRoboticHeadInterface::Get3SoundBuffer | ( | CMatrixTemplate< int > & | buf | ) |
Debug only!!! This function return the last 500 acquired samples for each sound channel.
void mrpt::hwdrivers::CRoboticHeadInterface::GetGain | ( | int & | _gain, |
int & | channel | ||
) |
Read the gain for the amplifier of the ear "channel", where channel is 0, 1 or 2.
void mrpt::hwdrivers::CRoboticHeadInterface::GetSoundLocation | ( | int & | ang | ) |
This function return the angle where last sound where detected.
This angle is related to the robot pose, NOT head pose.
angle > 0deg --> Sound detected in the left angle = 0deg --> Sound detected in front of the head angle < 0deg --> Sound detected in the right
void mrpt::hwdrivers::CRoboticHeadInterface::loadConfig_sensorSpecific | ( | const mrpt::utils::CConfigFileBase * | configSource, |
const std::string & | iniSection | ||
) | [protected] |
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.
void mrpt::hwdrivers::CRoboticHeadInterface::setDeviceSerialNumber | ( | const std::string & | deviceSerialNumber | ) | [inline] |
Changes the serial number of the device to open.
Definition at line 97 of file CRoboticHeadInterface.h.
bool mrpt::hwdrivers::CRoboticHeadInterface::SetGain | ( | int & | new_gain, |
int & | channel | ||
) |
Set the gain for the amplifier each ear.
The value range is [0x00(min) .. 0x7F(max)]. The value 0x80 set the resistor in high impedance state, ¡¡¡DON'T USE IT!!!
void mrpt::hwdrivers::CRoboticHeadInterface::SetHeadPose | ( | int & | yaw, |
int & | pitch | ||
) |
Move the head in:
elevation = 'yaw' degrees orientation = 'pitch' degrees
std::vector<int32_t> mrpt::hwdrivers::CRoboticHeadInterface::gain [private] |
Definition at line 73 of file CRoboticHeadInterface.h.
int mrpt::hwdrivers::CRoboticHeadInterface::head_pitch [private] |
Definition at line 74 of file CRoboticHeadInterface.h.
int mrpt::hwdrivers::CRoboticHeadInterface::head_yaw [private] |
Definition at line 74 of file CRoboticHeadInterface.h.
std::string mrpt::hwdrivers::CRoboticHeadInterface::m_serialNumber [private] |
Definition at line 72 of file CRoboticHeadInterface.h.
Definition at line 70 of file CRoboticHeadInterface.h.
Definition at line 71 of file CRoboticHeadInterface.h.
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011 |