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
文章来源:https://www.toymoban.com/news/detail-682526.html
(2)、按照如下提示,加入后重启启动即可实现自启动
文章来源地址https://www.toymoban.com/news/detail-682526.html
到了这里,关于ubuntu下自启动设置,为了开机自启动launch文件的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!