ROS:linux shell運行多個shell(運行多個程序)

在linux中開啓多個窗口,需要切換,比較麻煩,可以寫入到一個腳本中,可以同時打開多個console/shell。

shell代碼如下:

#!/bin/bash
# by wishchin 2020-05-12  version 1.0
## # Option “-x” is deprecated and might be removed in a later version of gnome-terminal.
## Use “-- ” to terminate the options and put the command line to execute after it.

#start
source ~/catkin_ws/devel/setup.bash
{
#python service......
gnome-terminal -t "python_trans" -x bash -c "python2 point_2_image2.py;exec bash"
}&

sleep 3s
{
#roscore
gnome-terminal -t "roscore" -x bash -c "roscore;exec bash"
}&

sleep 3s
{
#cloud process!
gnome-terminal -t "rtab_cloud_pro" -x bash -c "rosrun nlink rtab_cloud_pro;exec bash"
}&

sleep 5s
{
#rs_rtabmap.launch
gnome-terminal -t "rs_rtabmap" -x bash -c "cd ~/catkin_ws;roslaunch src/realsense-ros/realsense2_camera/launch/rs_rtabmap.launch  ;exec bash"
}&

#end 

結果:在一個shell中打開多個tab,依次運行!

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章