在树莓派ubuntu-mate上开机自启动roslaunch

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在树莓派ubuntu-mate上开机自启动roslaunch相关的知识,希望对你有一定的参考价值。

参考:

http://blog.csdn.net/flywiththejet/article/details/55258030
 
1.将多个要启动的ros node写入同一个launch文件:
如my_robot_name_2dnav/launch/nav_patrol.launch
 
2.将要启动的roslaunch命令加入~/.bashrc文件中:
在~/.bashrc文件末尾添加如下内容:
...
...
source /opt/ros/indigo/setup.bash
source ~/catkin_ws/devel/setup.bash
export ROS_MASTER_URI=http://192.168.192.166:11311
export ROS_HOSTNAME=192.168.192.166
 
#robot auto start
if rostopic list ; then
  echo "roscore and robot_auto_start started!"
else
  date >> ~/start_log.txt
  echo ":nav_patrol running" >> ~/start_log.txt
  nohup roslaunch my_robot_name_2dnav nav_patrol.launch & >> ~/start_log.txt
  sleep 30
fi
...
...
 
3.实现系统开机自动登录功能
sudo apt-get install lightdm
vim /etc/lightdm/lightdm.conf
将#autologin-user= 改为 autologin-user=ubuntu
 
4.sudo reboot就ok了

以上是关于在树莓派ubuntu-mate上开机自启动roslaunch的主要内容,如果未能解决你的问题,请参考以下文章

树莓派设置开机启动脚本

利用cpolar-内网穿透家中的树莓派,并开机自启动

树莓派进阶之路 (033) - 开机启动自定义脚本

树莓派3B 安装ubuntu-mate笔记

树莓派怎么开机就执行一条命令啊?

树莓派开机自启python gui程序