ros句柄的作用:
1.Automatic Startup and Shutdown
On creation, if the internal node has not been started already, ros::NodeHandle will start the node. Once all ros::NodeHandleinstances have been destroyed, the node will be automatically shutdown.
在节点初始化和关闭一节中,使用ros::NodeHandle管理节点的内部引用,使启动和关闭一个节点变得简单.
在创建时,如果一个内部节点没有被启动,节点句柄将启动该节点.一旦所有的节点句柄实例被销毁,那么节点将被自动关闭.
2.Namespaces
NodeHandle
s let you specify a namespace to their constructor:
ros::NodeHandle nh("my_namespace")
This makes any
relative
name
used with that
NodeHandle
relative to
<node_namespace>/my_namespace
instead of just
<node_namespace>
.
这使节点拥有相对名字<node_namespace>/my_namespace,而不仅仅是<node_namespace>
未完.....