ROS中使用sh脚本文件启动多个launch文件

引言:在实际应用中,往往需要同时启动多个节点,可以采用launch文件的方式启动,也可以采用sh脚本文件启动。通常需要启用延时启动的话节点,一般使用sh脚本启动。如果再把sh脚本设置成自启动脚本,则可以实现开机自启动效果,自启动可以参考博客其他教程

###gmapping with abot###
gnome-terminal --window -e 'bash -c "roscore; exec bash"' \
--tab -e 'bash -c "sleep 5; source ~/cwkj_ws/devel/setup.bash; roslaunch abot_bringup robot_with_imu.launch; exec bash"' \
--tab -e 'bash -c "sleep 5; source ~/cwkj_ws/devel/setup.bash; roslaunch robot_slam navigation.launch; exec bash"' \
--tab -e 'bash -c "sleep 5; source ~/cwkj_ws/devel/setup.bash; roslaunch track_tag usb_cam_with_calibration.launch; exec bash"' \
--tab -e 'bash -c "sleep 5; source ~/cwkj_ws/devel/setup.bash; roslaunch find_object_2d find_object_2d.launch; exec bash"' \
--tab -e 'bash -c "sleep 5; source ~/cwkj_ws/devel/setup.bash; rosrun robot_voice tts_subscribe; exec bash"' \
--tab -e 'bash -c "sleep 5; source ~/cwkj_ws/devel/setup.bash; roslaunch robot_slam multi_goal.launch; exec bash"' \

你可能感兴趣的:(前端,ROS,无人机,c++,linux)