note-ros-控制小海龟到达指定点
ubnutu:14.04
ros:indigo
传送门:ros小海龟定点移动(程序)
https://download.****.net/download/qq_33168256/10703620
- 工程:catkin_ws
- 程序包:turtle_crl
- 涉及ros知识点:发布,订阅。
- 效果:
- 运行步骤:
- 新终端1:
[email protected]:~$ roscore
- 新终端2
[email protected]:~$ rosrun turtlesim turtlesim_node
- 新终端2
[email protected]:~$ source ~/catkin_ws/devel/setup.bash
[email protected]:~$ rosrun turtle_crl turtlectrl
- 新终端1:
- 代码文件:
程序包传送门:ros小海龟定点移动(程序)
https://download.****.net/download/qq_33168256/10703620
1.CMakeLists.txt
2.package.xml
3.turtlectrl.cpp
其他:
------- 利用launch文件同时启动小海龟和控制程序。
- 代码文件:
–turtle_l.launch
<launch>
<node pkg="turtlesim" name="turtle1" type="turtlesim_node"/>
<node pkg="turtle_crl" name="ctrl1" type="turtlectrl"/>
</launch>
或者
<launch>
<group ns="turtlespcae1">
<node pkg="turtlesim" name="turtle1" type="turtlesim_node"/>
<node pkg="turtle_crl" name="ctrl1" type="turtlectrl"/>
</group>
</launch>
两者的不同之处在于,后者新命名了一个新的命名空间“turtlespcae1”
- 执行步骤:
- 新终端1:
[email protected]:~$ roscore
- 新终端2
[email protected]:~$ source ~/catkin_ws/devel/setup.bash
[email protected]:~$ roslaunch turtle_crl turtle_l
此时可以发现出现了小海龟,并且执行了程序。
- 新终端1:
- 问题:
没有跳出新的终端现实程序中输出
的文字消息。