1.在/catkin_ws/src/下面创建learning_launch功能包
$ catkin_create_pkg learning_launch
2.在learning_launch下创建launch文件夹
3.launch文件夹下面创建turtle.launch,写入启动文件,并将其改成XML格式
<launch>
<!-- Turtlesim Node-->
<node pkg="turtlesim" type="turtlesim_node" name="sim"/>
<node pkg="turtlesim" type="turtle_teleop_key" name="teleop" output="screen"/>
</launch>
4.在/catkin_ws/下面编译一下,别忘了配置环境变量,并且执行以下指令就可控制小海龟了
$ catkin_make
$ roslaunch learning_launch turtle.launch