IRI ROS Specific Driver Class. More...
#include <voice_recognition_alg.h>
Public Types | |
typedef iri_voice_recognition::VoiceRecognitionConfig | Config |
define config type | |
Public Member Functions | |
void | config_update (Config &new_cfg, uint32_t level=0) |
config update | |
void | finalize () |
void | initialize () |
std::string | iteration () |
void | lock (void) |
Lock Algorithm. | |
void | setFilePath (std::string path) |
bool | try_enter (void) |
Tries Access to Algorithm. | |
void | unlock (void) |
Unlock Algorithm. | |
VoiceRecognitionAlgorithm (void) | |
constructor | |
~VoiceRecognitionAlgorithm (void) | |
Destructor. | |
Public Attributes | |
int | answerCode_ |
Config | config_ |
config variable | |
Protected Member Functions | |
std::string | answer_type (std::string answerfn) |
std::string | answer_type_location (std::string answerfn, std::string loc) |
std::string | generate_answer (double *probs, char **sentences_str, int n) |
std::string | outputs (const args_t *args, lattice_t *lattice) |
Protected Attributes | |
acquisitor_t * | acquisitor |
CMutex | alg_mutex_ |
define config type | |
args_t * | args |
decoder_t * | decoder |
std::string | filePath_ |
IRI ROS Specific Driver Class.
Definition at line 68 of file voice_recognition_alg.h.
typedef iri_voice_recognition::VoiceRecognitionConfig VoiceRecognitionAlgorithm::Config |
define config type
Define a Config type with the VoiceRecognitionConfig. All driver implementations will then use the same variable type Config.
Definition at line 98 of file voice_recognition_alg.h.
constructor
In this constructor parameters related to the specific driver can be initalized. Those parameters can be also set in the openDriver() function. Attributes from the main node driver class IriBaseDriver such as loop_rate, may be also overload here.
Definition at line 29 of file voice_recognition_alg.cpp.
Destructor.
This destructor is called when the object is about to be destroyed.
Definition at line 33 of file voice_recognition_alg.cpp.
std::string VoiceRecognitionAlgorithm::answer_type | ( | std::string | answerfn | ) | [protected] |
Definition at line 142 of file voice_recognition_alg.cpp.
std::string VoiceRecognitionAlgorithm::answer_type_location | ( | std::string | answerfn, |
std::string | loc | ||
) | [protected] |
Definition at line 172 of file voice_recognition_alg.cpp.
void VoiceRecognitionAlgorithm::config_update | ( | Config & | new_cfg, |
uint32_t | level = 0 |
||
) |
config update
In this function the driver parameters must be updated with the input config variable. Then the new configuration state will be stored in the Config attribute.
new_cfg | the new driver configuration state |
level | level in which the update is taken place |
Definition at line 37 of file voice_recognition_alg.cpp.
void VoiceRecognitionAlgorithm::finalize | ( | ) |
Definition at line 105 of file voice_recognition_alg.cpp.
std::string VoiceRecognitionAlgorithm::generate_answer | ( | double * | probs, |
char ** | sentences_str, | ||
int | n | ||
) | [protected] |
Definition at line 215 of file voice_recognition_alg.cpp.
Definition at line 49 of file voice_recognition_alg.cpp.
std::string VoiceRecognitionAlgorithm::iteration | ( | ) |
Definition at line 117 of file voice_recognition_alg.cpp.
void VoiceRecognitionAlgorithm::lock | ( | void | ) | [inline] |
Lock Algorithm.
Locks access to the Algorithm class
Definition at line 123 of file voice_recognition_alg.h.
std::string VoiceRecognitionAlgorithm::outputs | ( | const args_t * | args, |
lattice_t * | lattice | ||
) | [protected] |
Definition at line 433 of file voice_recognition_alg.cpp.
void VoiceRecognitionAlgorithm::setFilePath | ( | std::string | path | ) |
Definition at line 112 of file voice_recognition_alg.cpp.
bool VoiceRecognitionAlgorithm::try_enter | ( | void | ) | [inline] |
Tries Access to Algorithm.
Tries access to Algorithm
Definition at line 139 of file voice_recognition_alg.h.
void VoiceRecognitionAlgorithm::unlock | ( | void | ) | [inline] |
Unlock Algorithm.
Unlocks access to the Algorithm class
Definition at line 130 of file voice_recognition_alg.h.
acquisitor_t* VoiceRecognitionAlgorithm::acquisitor [protected] |
Definition at line 84 of file voice_recognition_alg.h.
CMutex VoiceRecognitionAlgorithm::alg_mutex_ [protected] |
define config type
Define a Config type with the VoiceRecognitionConfig. All driver implementations will then use the same variable type Config.
Definition at line 77 of file voice_recognition_alg.h.
Definition at line 161 of file voice_recognition_alg.h.
args_t* VoiceRecognitionAlgorithm::args [protected] |
Definition at line 82 of file voice_recognition_alg.h.
config variable
This variable has all the driver parameters defined in the cfg config file. Is updated everytime function config_update() is called.
Definition at line 106 of file voice_recognition_alg.h.
decoder_t* VoiceRecognitionAlgorithm::decoder [protected] |
Definition at line 83 of file voice_recognition_alg.h.
std::string VoiceRecognitionAlgorithm::filePath_ [protected] |
Definition at line 80 of file voice_recognition_alg.h.