launch文件使用的时xml格式,使用方便,只要直到每个标签表示什么含义,并且每个标签有哪些属性就很好用。感觉有点像编网页啊......
<launch>,launch文件最基本的标签,写在文件头尾,表示这是一个launch文件。
<node>,运行ros节点。可以设置一些属性。
name = "随便起",必填
pkg = "包名",必填
type = "节点名",必填
output = "screen",打印到屏幕
respawn = "true",节点停止时重启该节点
required = "true",节点停止时终止launch上的其他节点,并且将launch退出运行
ns = "命名空间名",节点的全局名称变为“/命名空间/节点名”而不是原来的“/节点名”,用于异步使用两个相同的节点,比如教程里的两只小乌龟
<node>一些元素</node>
<remap from = "xxx/xxx" to "ooo" /> 重命名节点名
当launch文件需要启动其他launch文件时
<include file = "$(find package_name)/launch/launch_file_name" />
其他的暂时没有用到,用到之后再补充。