int main(int argc,char** argv) { ros::init(argc,argv,"localizationISL"); QApplication app(argc,argv); CommClient commclient; RosThread* rosthread = new RosThread(&commclient); commclient.rosthread = rosthread; QThread thr; rosthread->moveToThread(&thr); QObject::connect(rosthread,SIGNAL(rosFinished()),&thr,SLOT(quit())); QObject::connect(&thr,SIGNAL(finished()),&app,SLOT(quit())); QObject::connect(&thr,SIGNAL(finished()),rosthread,SLOT(deleteLater())); QObject::connect(&thr,SIGNAL(started()),rosthread,SLOT(work())); thr.start(); return app.exec(); }
int main(int argc,char** argv){ QApplication app(argc,argv); ros::init(argc,argv,"taskHandlerISLH"); RosThread* rosthread = new RosThread; QThread* worker = new QThread(&app); rosthread->moveToThread(worker); QObject::connect(rosthread,SIGNAL(rosFinished()),worker,SLOT(quit())); QObject::connect(worker,SIGNAL(finished()),&app,SLOT(quit())); QObject::connect(worker,SIGNAL(finished()),rosthread,SLOT(deleteLater())); QObject::connect(worker,SIGNAL(started()),rosthread,SLOT(work())); worker->start(); return app.exec(); }
int main(int argc,char** argv){ QApplication app(argc,argv); ros::init(argc,argv,"hotspothandlerISL"); RosThread* rosthread = new RosThread; QThread* worker = new QThread(&app); rosthread->moveToThread(worker); // QObject(&app,SIGNAL(aboutToQuit()),rosthread,SLOT(shutdownROS())); QObject::connect(rosthread,SIGNAL(rosFinished()),worker,SLOT(quit())); QObject::connect(worker,SIGNAL(finished()),&app,SLOT(quit())); QObject::connect(worker,SIGNAL(finished()),rosthread,SLOT(deleteLater())); QObject::connect(worker,SIGNAL(started()),rosthread,SLOT(work())); worker->start(); //ros::spin(); // ros::Rate loop_rate(10); // QTimer* time = new QTimer(0); // int count = 0; /* while (ros::ok()) { robotContoller(vel, numOfRobots, bin, bt, b_rs, ro, kkLimits); ros::spinOnce(); loop_rate.sleep(); ++count; } return 0;*/ return app.exec(); }
int main(int argc,char** argv) { ros::init(argc,argv,"communicationISLH"); QApplication app(argc,argv); CommunicationManager manager; RosThread* rosthread = new RosThread(&manager); manager.rosthread = rosthread; QThread thr; rosthread->moveToThread(&thr); QObject::connect(rosthread,SIGNAL(rosFinished()),&thr,SLOT(quit())); QObject::connect(&thr,SIGNAL(finished()),&app,SLOT(quit())); QObject::connect(&thr,SIGNAL(finished()),rosthread,SLOT(deleteLater())); QObject::connect(&thr,SIGNAL(started()),rosthread,SLOT(work())); thr.start(); manager.startt(); return app.exec(); // ros::NodeHandle n; // ros::Subscriber amclSub = n.subscribe("amcl_pose",2,amclPoseCallback); // ros::spin(); // tcpComm comm; // comm.myServer->setupServer(); }
int main(int argc, char *argv[]) { std::cout << "Starting drone_gui Node" << std::endl; // ROS ros::init(argc, argv, "drone_gui"); RosThread t; PingThread p; // UI QApplication a(argc, argv); tum_ardrone_gui w; // make them communicate with each other t.gui = &w; w.rosThread = &t; p.gui = &w; p.rosThread = &t; w.pingThread = &p; //AED added dynamic_reconfigure::Server<tum_ardrone::GUIParamsConfig> srv; dynamic_reconfigure::Server<tum_ardrone::GUIParamsConfig>::CallbackType f; f = boost::bind(&tum_ardrone_gui::dynConfCb, &w, _1, _2); srv.setCallback(f); // start them. t.startSystem(); p.startSystem(); w.show(); // wait until windows closed.... int ec = a.exec(); // stop ROS again.... t.stopSystem(); p.stopSystem(); std::cout << "Exiting drone_gui Node" << std::endl; return ec; }
int main(int argc, char *argv[]) { std::cout << "Starting drone_gui Node" << std::endl; // ROS ros::init(argc, argv, "drone_gui"); RosThread t; PingThread p; // UI QApplication a(argc, argv); tum_ardrone_gui w; // make them communicate with each other t.gui = &w; w.rosThread = &t; p.gui = &w; p.rosThread = &t; w.pingThread = &p; // start them. t.startSystem(); p.startSystem(); w.show(); // wait until windows closed.... int ec = a.exec(); // stop ROS again.... t.stopSystem(); p.stopSystem(); std::cout << "Exiting drone_gui Node" << std::endl; return ec; }