ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

First of all roslaunch is not an executable file, it's just python script, so you should run python program with args pointed to roslaunch script. Second please read carefully QT docs about argument list, here an example from docs:

  QObject *parent;
  ...
  QString program = "./path/to/Qt/examples/widgets/analogclock";
  QStringList arguments;
  arguments << "-style" << "fusion";

  QProcess *myProcess = new QProcess(parent);
  myProcess->start(program, arguments);

And finally I suggest you start your program from terminal where ros environment already set (open terminal, source setup.bash from ros workspace). If it works then you can try to add this environment directly to QProcess, but it's can be tricky since setup.bash executes multiple environment changes.

So I believe it should be like this

QString program = "python";
QStringList arguments;
arguments << "roslaunch" << "jackal_gazebo"<<"jackal_world.launch";

And environment for ros should be already set in the terminal where you run your app.