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

Run nodes in tabs of a terminal by roslaunch (e.g. roxterm)

asked 2017-11-28 03:49:25 -0500

Nicolas gravatar image


we would like to run the processes started by roslaunch in individual tabs of an X-terminal. It's a bit against the concepts of rosout, but this allows to quickly switch between the output of nodes and also allows to interact with them during development.

Some X terminals allow to create a new tab from the shell, using e.g. roxterm --tab. This can be used as a launch prefix. However, roxterm --tab does not wait for the launched process to finish. As a result, roslaunch can no longer control it's child processes, and thinks the node exited directly.

I am thinking about a wrapper for roxterm --tab that behaves as expected by roslaunch. The wrapper must: - Wait for the ROS node ran within the tab and return its exit code - Forward signals to the ROS node - Not register as a ROS node in any way

Is this enough, or is there anything else?

Best Regards!

edit retag flag offensive close merge delete


can we open mutilple tabs of ros prompts in single terminal window and without maximizing it in small size?

noor gravatar image noor  ( 2019-12-18 00:54:57 -0500 )edit

You can do this by using the shortcut on the terminal: CTRL + SHIFT + T , if you're asking this by saying 'ros prompt'

ermanas gravatar image ermanas  ( 2019-12-18 02:25:38 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-11-28 08:08:37 -0500

I had a similar problem, and my solution was to create a bash file, where I created different tabs and launch nodes or launch files in each one of them. I used gnome-terminal and had to add some sleeps in order to wait for the simulator to start running, but maybe you can also use them in the launch prefix. Here are the contents of the bash file.

   echo "Launching: roscore"
   gnome-terminal --window --maximize -x sh -c "roscore; exit"
   sleep 2
   rosparam set /prediction_time 10.0
   echo "Launching: stage_and_maps.launch"
   gnome-terminal --window --maximize -x sh -c "roslaunch stage_and_maps.launch; exit"
   echo "Waiting 10s left"
   sleep 10
   echo "Launching: prediction.launch"
   gnome-terminal --tab --maximize -x sh -c "roslaunch prediction.launch; exit"

Hope it helps!!


edit flag offensive delete link more

Question Tools



Asked: 2017-11-28 03:49:25 -0500

Seen: 1,402 times

Last updated: Dec 18 '19