Revision b1a51350 server/src/MiddlewareROS.cpp

View differences:

server/src/MiddlewareROS.cpp
48 48
    actionlib::SimpleActionClient<actionspec> *ac = new actionlib::SimpleActionClient<actionspec>(scope, true);
49 49

  
50 50
    if (!ac->waitForServer(ros::Duration(1))){
51
        char buf[256];
52
        snprintf(buf, 256, "ERROR: action service %s not ready", scope.c_str());
53
        throw runtime_error(buf);
51
        printf("> ERROR: action service %s not ready, wait timed out...\n", scope.c_str());
52
        return NULL;
54 53
    }
55 54
    return ac;
56 55
}
......
102 101

  
103 102
    //create tts client
104 103
    tts_ac = create_action_client<hlrc_server::ttsAction>(base_scope + "/tts_provider");
104
    if (tts_ac == NULL){
105
        printf("> tts action service not available, will not do any TTS !\n");
106
    }
105 107

  
106 108

  
107 109

  
......
116 118

  
117 119
//call a tts system to convert a string to an utterance
118 120
boost::shared_ptr<Utterance> MiddlewareROS::tts_call(string text){
119
    //double tts_timeout = 1.0; //seconds. DO NOT CHANGE THIS!
120

  
121 121
    boost::shared_ptr<Utterance> utterance(new Utterance());
122 122

  
123
    //double tts_timeout = 1.0; //seconds. DO NOT CHANGE THIS!
124
    if (tts_ac == NULL){
125
        printf("> tts action service not available. will not speak '%s'\n", text.c_str());
126
        return utterance;
127
    }
128

  
123 129
    hlrc_server::ttsGoal goal;
124 130

  
125 131
    goal.text = text;

Also available in: Unified diff