QT creator UI to run roslaunch by clicking a button
Hello I'm quite new on this ROS and QT. I have difficulty when i follow this.
I want to launch a file when i clicked a button. I know i must use QProcess for that, but when I follow the forum below, my UI doesn't do anything (sometimes it exit by itself).
any help please
here is my code
QString program = "roslaunch jackal_gazebo jackal_world.launch";
QProcess *myProcess = new QProcess(this);
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("launch","/opt/ros/melodic/share/jackal_gazebo");
myProcess->setProcessEnvironment(env);
myProcess->start(program);
myProcess->waitForStarted(-1);
thank you best reagrds