Revision 888a909b server/include/ROS/UtteranceCallbackWrapperROS.h
| server/include/ROS/UtteranceCallbackWrapperROS.h | ||
|---|---|---|
| 51 | 51 |
//everything is ok, will be cleared on failures |
| 52 | 52 |
feedback.result = 1; |
| 53 | 53 |
|
| 54 |
boost::shared_ptr<Utterance> utterance(new Utterance());
|
|
| 54 |
std::shared_ptr<Utterance> utterance(new Utterance());
|
|
| 55 | 55 |
|
| 56 | 56 |
//copy values: |
| 57 | 57 |
utterance->set_text(request->utterance.text); |
| 58 | 58 |
|
| 59 |
boost::shared_ptr<AudioData> audio_data(new AudioData());
|
|
| 59 |
std::shared_ptr<AudioData> audio_data(new AudioData());
|
|
| 60 | 60 |
if (!extract_audio(request->utterance.audio, audio_data)){
|
| 61 | 61 |
feedback.result = 0; |
| 62 | 62 |
} |
| ... | ... | |
| 78 | 78 |
|
| 79 | 79 |
|
| 80 | 80 |
//convert ros message audio data to our own implementation |
| 81 |
bool extract_audio(hlrc_server::soundchunk sound_chunk, boost::shared_ptr<AudioData> audio_data){
|
|
| 81 |
bool extract_audio(hlrc_server::soundchunk sound_chunk, std::shared_ptr<AudioData> audio_data){
|
|
| 82 | 82 |
//extract data: |
| 83 | 83 |
unsigned int audio_len = sound_chunk.data.size(); |
| 84 | 84 |
char *audio_data_char = (char *)sound_chunk.data.data(); |
Also available in: Unified diff