ROS中提供了开机自动启动节点的工具robot_upstart,借助linux systemd工具实现守护进程开机启动功能.
1 systemd工具简介
关注点:systemd启动的服务,通过配置文件传递环境变量
2 robot_upstart安装节点
sudo apt-get install ros-kinetic-robot-upstart
rosrun robot_upstart install package_name/launch/start.launch --logdir /$HOME/.ros/log --job mine_job
sudo systemctl daemon-reload && sudo systemctl start mine_job
restart job:
sudo systemctl restart mine_job
stop job:
sudo systemctl stop mine_job
delete:
rosrun robot_upstart uninstall mine_job