Running multiple command-line apps from a Qt GUI app in Ubuntu and getting the console output

StackOverflow https://stackoverflow.com/questions/19216848

  •  30-06-2022
  •  | 
  •  

質問

I am developing a robotics application on Ubuntu 12.04 (Precise) and ROS fuerte. I have about 10 different nodes (processes) that need to be run and to switch between the different operation modes of the robot, I would also have to kill and spawn these nodes dynamically. The usual way is, of course, launching them from terminal, however I want to provide an easy-to-use GUI interface.

Is there any way I can start terminal applications from C++ code in Ubuntu while getting all their output? I want to collect all output from all the running apps and display it in a single view. It should also be possible to spawn and kill these apps on the go.

Or perhaps there's an ROS-way of doing this that I am not aware of?

Thanks!

役に立ちましたか?

解決

The QProcess class is what you're looking for.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top