How to launch a roslaunch in Qt with a terminal (GUI) ?
I have created a GUI with Qt and now I want to link the GUI with my ROS program by launching the launch file. To launch my launch file I have found a solution : in my GUI (Qt C++) open a terminal and execute my roslaunch. But it's not as easy as it seems...
I have found 2 possible solutions in Qt:
- stdlib.h : system("gnome-terminal -e roslaunch my_package file.launch");
I get this error : (gnome-terminal:386): GLib-GIO-CRITICAL **: g_settings_get: the format string may not contain '&' (key 'host' from schema 'org.gnome.system.proxy.ftp'). This call will probably stop working with a future version of glib.
It seems that the spaces in "roslaunch my_package file.launch" don't work.
QProcess builder;
builder.start("gnome-terminal", QStringList() << "roslaunch my_package file.launch");
In these two cases, a terminal opens but nothing append... I have tried with a simple exemple (mkdir file) and the command works, It seems that the roslaunch is not recognized as a command.
Do you have a solution ? Any ideas ?
Roslaunch provides Python API (Example). One possible solution is to call roslaunch Python API from cpp(call Python from cpp).