QTCreator execute roslaunch with GUI button

asked 2017-09-30 06:55:00 -0500

FábioBarbosa gravatar image

Hi!

I have Ubuntu 14.04 and i am using ROS indigo. I am currently developing an application in QTCreator where with a click of a button it launches a roslaunch command. Unfortunately when i execute my application it doesn't happen anything.

I tried the solutions they say in this link but it didn't help it at all...

I have configure my .bahrc to contain the source command with the correct path.

So what i am thinking is, maybe the problem isn't on the code but in the compilation or something like that. If it is i don't known how to configure that part.

Can someone help me?

Here's my code for the buttonclick method:

void MainWindow::on_startroslaunchButton_clicked()
{
  //proc->start("gnome-terminal", QStringList() << "roslaunch"<<"signbot_f_description"<<"rviz_model.launch");
  //proc->start("bash", QStringList() << " -c gnome-terminal source ~/Desktop/signbot/devel/setup.bash; roslaunch signbot_f_description rviz_model.launch");

  //proc->start("roslaunch signbot_f_description rviz_model.launch");

  QString program = "gnome-terminal roslaunch signbot_f_description rviz_model.launch";

  QProcess *myProcess = new QProcess();
  QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
  myProcess->setProcessEnvironment(env);
  myProcess->start(program);
  myProcess->waitForStarted(-1);

}
edit retag flag offensive close merge delete

Comments

hey! any news on this topic? Same interest here!

polde gravatar image polde  ( 2018-05-23 04:31:30 -0500 )edit