int main(int argc,char** argv) { ros::init(argc,argv,"tbk",ros::init_options::AnonymousName | ros::init_options::NoSigintHandler); TBK_Node tbk; boost::thread t = boost::thread(boost::bind(&TBK_Node::keyboardLoop, &tbk)); ros::spin(); t.interrupt(); t.join(); tbk.stopRobot(); tcsetattr(kfd,TCSANOW,&cooked); return(0); }
int main(int argc, char** argv) { ros::init(argc,argv,"tbk", ros::init_options::AnonymousName | ros::init_options::NoSigintHandler); TBK_Node tbk; // start two threads: waiting for keyboard and publishing velocity message boost::thread t = boost::thread::thread(boost::bind(&TBK_Node::keyboardLoop, &tbk)); boost::thread t2 = boost::thread::thread(boost::bind(&TBK_Node::pub_cmdvel, &tbk)); ros::spin(); t.interrupt(); t.join(); tbk.stopRobot(); tcsetattr(kfd, TCSANOW, &cooked); return(0); }