您的位置:首页 > Web前端 > Node.js

我的ROS学习之路—nodes

2016-11-16 13:53 141 查看
   ----publish----->
nodes                              topic

           <----subscrib-----

1、运行命令:
roscore

rosnode 命令格式:

ping    list   info   machine    kill     cleanup
ps: rosnode machine  可以显示计算机名

2、打开新的终端运行:
rosnode list


这表示当前只有一个节点在运行: rosout。因为这个节点用于收集和记录节点调

试输出信息,所以它总是在运行的。

3、运行:

rosnode info /rosout

4、使用 rosrun

syntax:
rosnode info /rosout


5、运行一个新的终端:

/rosout/turtlesim

6、节点重命名
关闭
rosrun  ctrl+c
运行:
rosrun turtlesim turtlesim_node __name:=my_turtle
参考:http://wiki.ros.org/Remapping%20Arguments

__name

__name is a special reserved keyword for "the name of the node." It lets you remap the node name without having to know its actual name. It can only be used if the program that is being launched contains one node.

__log

__log is a reserved keyword that designates the location that the node's log file should be written. Use of this keyword is generally not encouraged -- it is mainly provided for use by ROS tools likeroslaunch.

__ip and __hostname

__ip and __hostname are substitutes for ROS_IP and
ROS_HOSTNAME. Use of this keyword is generally not encouraged as it is provided for special cases where environment variables cannot be set.

__master

__master is a substitute for ROS_MASTER_URI. Use of this keyword is generally not encouraged as it is provided for special cases where environment variables cannot be set.

__ns

__ns is a substitute for ROS_NAMESPACE

. Use of this keyword is generally not encouraged as it is provided for special cases where environment variables cannot be set.

7、我们可以看到新的/my_turtle 节点。使用另外一个 rosnode 指令, ping, 来
rosnode ping my_turtle
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ros