roslaunch文件格式解析

roslaunch文件格式解析

roslaunch是ros中重要的概念,ros机器人系统是机器人系统就是一堆 node 和 topic (再添加一些 parameter, service 等)构成的网络(rosgraph),其中每个 node 都可以完成一定的功能。

使用ros launch可以一次性启动多个node相互关联并设置丰富的参数,是一种较好的结构。roslaunch 可以让所有的节点共享同一个终端。

一些网站

https://blog.youkuaiyun.com/qq_33444963/article/details/77893881 ROS笔记(一)xxx.launch文件详解

ros官方教程http://wiki.ros.org/ROS/Tutorials/Roslaunch%20tips%20for%20larger%20projects

关于ros的一些基本概念

Quick Overview of Graph Concepts 官方的一些解释

  • Nodes: A node is an executable that uses ROS to communicate with other nodes.
  • Messages: ROS data type used when subscribing or publishing to a topic.
  • Topics: Nodes can publish messages to a topic as well as subscribe to a topic to receive messages.
  • Master: Name service for ROS (i.e. helps nodes find each other)
  • rosout: ROS equivalent of stdout/stderr
  • roscore: Master + rosout + parameter server (parameter server will be introduced later)

ROS Node(节点)实际上只是ROS包中的一个可执行文件。ROS节点使用ROSclient(客户端)库与其他节点通信。节点可以publish or subscribe(发布或订阅)Topic(主题)。节点还可以提供或使用Service(服务)。

ROS client(客户端)库允许以不同编程语言编写的节点进行通信:

  • rospy = python client library python语言
  • roscpp = c++ client library C++语言

使用rosnode list可以查看当前运行的结点

ROS Topic(话题) 结点之间利用rostopic 话题进行通信 一个结点发布(publish)一个话题,另一个结点接收(subscribe)同样的话题来进行通信

可以利用rqt_graph来展示结点和话题之间的关系

rostopic命令可以让你了解关于topic的信息

  • rostopic bw     display bandwidth used by topic
    rostopic echo   print messages to screen
    rostopic hz     display publishing rate of topic    
    rostopic list   print information about active topics
    rostopic pub    publish data to topic
    rostopic type   print topic type
    

ROS Service

服务是节点相互通信的另一种方式。服务允许节点发送request请求并接收 response响应

rosservice命令可以了解ROS的 client/service框架

rosservice list         print information about active services
rosservice call         call the service with the provided args
rosservice type         print service type
rosservice find         find services by service type
rosservice uri          print service ROSRPC uri

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值