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;
}
Beispiel #2
0
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;
}