ROS学习手记 - 5 理解ROS中的基本概念_Services and Parameters

上一节完成了对nodes, Topic的理解,再深入一步: Services and Parameters

我不理解为何 ROS wiki 要把service与parameter放在一起介绍, 很想分开说,但限于 csdn blog 没有文章顺序调整功能。只能罢了~~

-----------------以下是我作的关于ROS Service的总结-------------------

关于ROS Service的总结:

  • 什么是ROS Service: 在wiki/tutorials/1.7 中,有“Understanding ROS Services and Parameters”一节, 我不理解为何要把service与parameter放在一起介绍。
    [概念concepts] ROS Service: Another way that Nodes communicate with nodes. A_node send a request to B_node, and B_node give a response.
    [命令Commands] sorservice list/call/type/find/uri    &   rossrv - this command is mainly for the .srv files operations

  • 什么定义了ROS Service: *.srv file - srv文件: 在wiki/tutorials/1.10  中,有“Creating Msg & Srv” 一节,我还是没理解为何要把srv文件和msg文件放在一起介绍。
    The function of srv file: Discribe/define the data type for a service. The data type of Req. & Resp. divided by '---'
    the srv file typically stored under ../workspace/src/package_name/srv/ path.
    [Create the srv file]: step1. echo "..." ./srv/filename.srv          step2. uncomment "gen_srv()" in CMakeList.txt file.
    [Use the srv file]: $rossrv show filename.srv , rossrv -- info of service definitions
  • 什么程序实现了ROS Servie: 在 wiki/tutorials/1.14 中,有“Writing a simpleService and Client(C++)” 一节, 其中详细介绍了Service_node & Client_node的程序实现。

-----------------以上是我作的关于ROS Service的总结-------------------

关于ROS Parameters的总结:

  • 什么是ROS Parameters: ROS Parameters 是ROS程序运行时所需要的参数,比如你的机器人的轮子的半径,你的gyro传感器是否具备等。

  • 如何修改和操作ROS Parameters: 这里我要引用一些高级的东东,简单的就不说了。link 是关于改了parameter没反应时的方法。还有要注意:
    rosparam set use_sim_time true
    rosparam delete /move_base
    以上俩关于rosparam 命令的使用方法mentioned in this blog: link
  • 如何在命令行中指派parameter的值:这个叫“Dynamic Reconfigure” ,具体方法:1. Python: Link   2. C++ Link

-----------------以下是我最初学习它的时候的手记-----------------

  1. Understanding ROS Services and Parameters

    This tutorial introduces ROS services, and parameters as well as using therosservice androsparam commandline tools.

Description: This tutorial introduces ROS services, and parameters as well as using the rosservice and rosparam commandline tools.

ROS Services

Services are another way that nodes can communicate with each other. Services allow nodes to send a request and receive a response.

Using rosservice

*rosservice* can easily attach to ROS's client/service framework with services. rosservice has many commands that can be used on topics, as shown below:

Usage:
    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

list
    type
    call

Using rosparam

*rosparam* allows you to store and manipulate data on the ROS Parameter Server. The Parameter Server can store integers, floats, boolean, dictionaries, and lists. rosparam uses the YAML markup language for syntax. In simple cases, YAML looks very natural: 1 is an integer, 1.0 is a float, one is a string, true is a boolean, [1, 2, 3] is a list of integers, and {a: b, c: d} is a dictionary. rosparam has many commands that can be used on parameters, as shown below:

Usage:

rosparam set            set parameter
    rosparam get            get parameter
    rosparam load           load parameters from file
    rosparam dump           dump parameters to file
    rosparam delete         delete parameter
    rosparam list           list parameter names

list
    set/get
    dump/load

Stack, Package, Nodes/Messages/Services/Libraries/Tools, 关系复习图如下:

posted on 2015-07-07 10:30 sonictl 阅读(...) 评论(...) 编辑 收藏

转载于:https://www.cnblogs.com/sonictl/p/6735547.html

ROS学习手记 - 5 理解ROS中的基本概念_Services and Parameters相关推荐

  1. ROS学习手记 - 2.1: Create and Build ROS Package 生成包(Python)

    ROS学习手记 - 2.1: Create and Build ROS Package 生成包(Python) ROS学习手记 - 2.1: Create and Build ROS Package ...

  2. ROS学习笔记十一:ROS中数据的记录与重放

    ROS学习笔记十一:ROS中数据的记录与重放 本节主要介绍如何记录一个正在运行的ROS系统中的数据,然后在一个运行的系统中根据记录文件重新产生和记录时类似的运动情况.本例子还是以小海龟例程为例. 记录 ...

  3. 转‘ROS学习心得——安装篇——ROS安装’

    ROS学习心得--安装篇--ROS安装 FOR THE SIGMA FOR THE GTINDER FOR THE ROBOMASTER 简介: ROS(Robot Operating System) ...

  4. ROS学习心得——安装篇——ROS安装

    ROS学习心得--安装篇--ROS安装 FOR THE SIGMA FOR THE GTINDER FOR THE ROBOMASTER 简介: ROS(Robot Operating System) ...

  5. ROS学习(二)ROS Noetic的简单测试

    文章目录 前言 正文 前言   在上一篇文章ROS学习(一)ROS Noetic安装及环境配置中完成了ROS Noetic安装及环境配置,但可惜的是,在我目前阅读的ROS的wiki文档中并没有说明如何 ...

  6. React最佳实践系列 —— 循序渐进理解 Dva中的model概念

    Dva最佳实践 -- 循序渐进理解 Dva中的model概念 一. 序 二. 在create-react-app中使用redux 1. 开始 2. 安装redux 三.异步action 四. Dva中 ...

  7. 【ROS学习记录】在gazebo中加入差分驱动插件后rostopic没有/cmd_vel话题的一种解决办法

    (1)背景:本人在b站学习的ros,自己安装的是ubuntu18.04,视频链接如下:[奥特学园]ROS机器人入门课程<ROS理论与实践>零基础教程_哔哩哔哩_bilibili 但是在P2 ...

  8. ROS学习:什么是ROS?

    前段时间开始接触和学习ROS , 特此纪录,希望能学有所成吧. ROS起源与发展 本世纪开始,关于人工智能的研究进入了大发展阶段,包括全方位的具体的 AI ,例如斯坦福大学人工智能实验室STAIR(S ...

  9. ROS学习笔记02、ROS使用C++、Python来实现HelloWorld

    文章目录 前言 一.创建工程文件目录 二.实现helloworld 2.1.创建ROS包 2.2.C++版的HelloWorld 2.3.Python版的HelloWorld 三. 借助launch文 ...

最新文章

  1. Error was tenMinuteCache Cache: The Disk store is not active.
  2. android oom 检测工具,Android中UI检测、内存泄露、OOM、等优化处理
  3. 14行代码满分:1037 在霍格沃茨找零钱 (20分)
  4. 前端学习(3251):dom的diff算法2
  5. anaconda 设置python3为主_【windows】下Anaconda详细安装过程
  6. Tricks(三十三)—— 自定义 zipWithIndex
  7. 数组去重的JavaScript实现
  8. label字符自动换行(转自网络)
  9. 上海交通大学计算机应用作业,上海交通大学继续教育学院计算机应用基础(二)第六次作业计算机安全多媒体_1...
  10. eclipse语言包安装太慢,或者卡住不动的解决方法
  11. OCR 识别翻译图片中的文字:iText for Mac
  12. VEX到底是一种什么机器人?和乐高有什么区别?
  13. 政务内网、政务外网、政务专网
  14. 如何推广网站 网站推广增加访问量的29种方法
  15. 电源防反接电路设计(重要)
  16. Gson的JsonParser使用
  17. 京东2015校园招聘技术类笔试题
  18. 游戏开发笔记(一):一元夺宝
  19. 精通oracle 10gproc/c,读书笔记之---精通oracle10g.plsql
  20. CISC RISC ARM MIPS区别与联系

热门文章

  1. 文件操作(文件指针+顺序/随机读写)
  2. java异常处理封装_Java统一异常处理(配置文件集中化定义)
  3. 打印服务器协议,基于TCP/IP协议的嵌入式网络打印服务器设计
  4. tcp报文解析工具_15 张图,了解一下 TCP/IP 必知也必会的 10个要点
  5. geetest文件夹什么意思_手机文件夹是英文不敢删?只要找出这5个文件夹,能腾出大量内存...
  6. css设置按钮竖直方向居中_前端设计师必须知道的10个重要的CSS技巧
  7. 频繁项目集java实现_关联分析(2):Apriori产生频繁项集
  8. pycharm和jupyter notebook中的快捷键
  9. 我是如何解决jobtracker.info could only be replicated to 0 nodes, instead of 1这个问题的
  10. 那是我夕阳下的奔跑--一个萌新的觉醒