ROS Indigo beginner_Tutorials-09 编写简单的启动脚本文件
我使用的虚拟机软件:VMware Workstation 11
使用的Ubuntu系统:Ubuntu 14.04.4 LTS
ROS 版本:ROS Indigo
.launch文件 :
下面我们将介绍,如何编写一个启动脚本程序:(.launch文件)
还记得我们在 创建ROS软件包教程 中创建的第一个程序包(beginner_tutorials)吗,现在我们要使用它。在 beginner_tutorials 软件包里新建一个名为 launch 的文件夹。(用来保存 launch 启动脚本的):
$ roscd beginner_tutorials
$ mkdir launch
$ cd launch
$ gedit turtlemimic.launch #使用你喜欢的编译器打开turtlemimic.launch,对其进行编辑
添加下面的代码:
<launch>
<group ns="turtlesim1">
<node pkg="turtlesim" name="sim" type="turtlesim_node"/>
</group>
<group ns="turtlesim2">
<node pkg="turtlesim" name="sim" type="turtlesim_node"/>
</group>
</

本文介绍了在ROS Indigo环境下如何编写和运行.launch启动脚本,包括创建带有命名空间的节点,以及使用roslaunch命令启动脚本。内容涉及启动脚本的作用、结构,以及如何通过launch文件控制多个节点的启动和交互。
最低0.47元/天 解锁文章
582





