您的位置:首页 > 运维架构 > Shell

ROS脚本开机自启动

2016-08-03 22:15 295 查看
说明:在控制机器人的卡片电脑,工控机,秒算等上面,往往要实现ROS节点的开机自启动。以本人系统为例:ubuntu 14.04 + ros indigo,通过秒算实现M100的控制相机的节点.

准备执行节点

首先要将自己要写入可执行的shell script里面, 例如:

#! /bin/bash

source /opt/ros/indigo/setup.sh
roslaunch /home/ubuntu/catkin_ws/dji_sdk_read_cam.launch


(注:第二行程序是开机声明一下ros的环境变量,第三行是你要执行的节点名称)

更改脚本可执行性

将上述脚本属性改为可执行:

sudo chmod +x /path/to/script.sh


添加开机运行

打开System –>Preferences –> Startup Application,点击添加,增加开机运行脚本。设置以下三项内容:

name –> rosnome

command –> gnome-terminal -x /path/to/script.sh

comment –> rosscripts

终端常开设置

打开终端,在Edit –>profile preferences–>title and command tab里面勾选hold the terminal open。

重启电脑,检查是否开机执行。

主要参考:http://ros-users.122217.n3.nabble.com/auto-start-ROS-launch-script-on-boot-up-td1687093.html

by Dr. Sword.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu shell ros dji M100