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;
}
Exemple #2
0
void Window::startPing()
{
    // Save ip data
    QFile file("./ip-address.txt");
    if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
        if(file.isWritable()) {
            const char *ip_address = IPInput->text().toAscii().data();
            file.write(ip_address, qstrlen(ip_address));
        }
    }
    file.close();


    stop = false;
    PingThread *t = new PingThread;
    t->window = this;
    t->start();
    StartButton->setEnabled(false);
    StopButton->setEnabled(true);
    IPInput->setEnabled(false);
}
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;
}