How i change the existing package with programme to what i need?
Hi , i am a newbie in ros and currently i am trying to rebuild a programme that came with the package. But how do i do that anyone have any idea? i am currently using rospeex to do voice recognition and answer. Initially i though that all that i was required to do was to change the source cpp file for the English version. After i did that , i rebuild it by using the catkin_build_isolated. However , despite that me changing the programme of the source code and using the catkin_build_isolated. The programme didnt change itself like it still only react to the two words " what time" while i tried to change it to "the time" just to see if the programme would actually be able to change. However it seems like its not possible. Anyone mind telling me where went wrong was it the fact that i used catkin_make_isolated ? because thats what the website actually says to use to compile the programme. Anyone have any suggestion or any ways in which i should do to be able to change the programme ?
I have made another file using their file as reference and apparently it keeps not getting any response from the server as the program uses the server of either google or national institute of information and communication technology.
I have tried to get the api key for google and manage to get one and adding it in and despite that i still get errors. while using the nict's server did not give me any response at all and instead a timeout.
Anyone have suggestions?
the cpp file from the package
#include <iostream> #include <sstream> #include <boost regex.hpp=""> #include <boost date_time="" posix_time="" posix_time.hpp=""> #include <ros ros.h=""> #include “rospeex_if/rospeex.h”
static rospeex::Interface interface;
void sr_response( const std::string& msg ) { using boost::posix_time::ptime; using boost::posix_time::second_clock; std::string msg_tr(msg); std::cerr << "you said : " << msg << std::endl; std::transform(msg_tr.begin(), msg_tr.end(), msg_tr.begin(), ::tolower);
boost::regex time_reg(".*what time.+");
if ( boost::regex_match(msg_tr, time_reg) )
{ std::string text = ""; ptime now = second_clock::local_time(); std::stringstream ss; ss << "It's " << now.time_of_day().hours() << ":" << now.time_of_day().minutes() << "."; text = ss.str(); std::cerr << "rospeex reply : " << text << std::endl; interface.say(text, "en", "nict"); } }
int main( int argc, char** argv ) { ros::init(argc, argv, "sr_ss_demo");
interface.init(); interface.registerSRResponse( sr_response ); interface.setSPIConfig("en", "nict"); ros::spin(); return 0; }