3. 在 2节的基础上 ,实现launch文件简单编写
实现效果:能够一次运行多个节点,包括2节中显示"ha 哈",乌龟显示,乌龟运动
1.在hello_ros功能包下,新建launch文件夹,在launch文件夹下新建.launch文件
2.在launch文件中写入
<launch><node pkg="hello_ros" type="hello_ros" name="ha" output="screen" />
<node pkg="turtlesim" type="turtlesim_node" name="t1" />
<node pkg="turtlesim" type="turtle_teleop_key" name="key" /></launch>
说明:
node 为包含的某个节点
pkg 为功能包
type 为被运行的节点文件
name 为节点命名
output 设置日志输出目标
3. 运行launch, roslaunch <包名> <launch文件名>
source ./devel/setup.bash
roslaunch hello_ros run.launch