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權(quán)限
sudo chmod 777 xxx.sh
3、添加到自啟動列表中
(1)、進入主菜單界面在搜索框中輸入startup applications
文章來源:http://www.zghlxwxcb.cn/news/detail-682526.html
(2)、按照如下提示,加入后重啟啟動即可實現(xiàn)自啟動
文章來源地址http://www.zghlxwxcb.cn/news/detail-682526.html
到了這里,關(guān)于ubuntu下自啟動設(shè)置,為了開機自啟動launch文件的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!