note-ros-控制小海龟到达指定点

ubnutu:14.04
ros:indigo
传送门:ros小海龟定点移动(程序)
https://download.****.net/download/qq_33168256/10703620

  1. 工程:catkin_ws
  2. 程序包:turtle_crl
  3. 涉及ros知识点:发布,订阅。
  4. 效果:
    note-ros-控制小海龟到达指定点
    note-ros-控制小海龟到达指定点
  5. 运行步骤:
    1. 新终端1:
      [email protected]:~$ roscore
    2. 新终端2
      [email protected]:~$ rosrun turtlesim turtlesim_node
    3. 新终端2
      [email protected]:~$ source ~/catkin_ws/devel/setup.bash
      [email protected]:~$ rosrun turtle_crl turtlectrl
  6. 代码文件:
    程序包传送门:ros小海龟定点移动(程序)
    https://download.****.net/download/qq_33168256/10703620

1.CMakeLists.txt
2.package.xml
3.turtlectrl.cpp

其他:

------- 利用launch文件同时启动小海龟和控制程序。

  1. 代码文件:
    –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. 执行步骤:
    1. 新终端1:
      [email protected]:~$ roscore
    2. 新终端2
      [email protected]:~$ source ~/catkin_ws/devel/setup.bash
      [email protected]:~$ roslaunch turtle_crl turtle_l
      此时可以发现出现了小海龟,并且执行了程序。
  2. 问题:
    没有跳出新的终端现实程序中输出
    的文字消息。