1、书写sh脚本文件 每隔5秒钟启动一个launch文件,也可以直接在一个launch文件中启动多个,这里为了确保启动顺利,添加了一些延时 #! /bin/bash ### BEGIN INIT sleep 5 gnome-terminal -- bash -c "source /opt/ros/melodic/setup.bash;source /home/abot/abot_ws/devel/setup.bash;roslaunch starrobot_bringup minimal.launch" sleep 5 gnome-terminal -- bash -c "source /opt/ros/melodic/setup.bash;source /home/abot/abot_ws/devel/setup.bash;roslaunch robot_bringup px4.launch" sleep 5 gnome-terminal -- bash -c "source /opt/ros/melodic/setup.bash;source /home/abot/abot_ws/devel/setup.bash;rosrun pwm_tran_cmd pwm_tran_cmd" sleep 5 wait exit 0 2、给与sh文件777权限 sudo chmod 777 xxx.sh 3、添加到自启动列表中 (1)、进入主菜单界面在搜索框中输入startup applications (2)、按照如下提示,加入后重启启动即可实现自启动