zoukankan      html  css  js  c++  java
  • ROS学习手记

    上一节完成了对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, 关系复习图如下:



  • 相关阅读:
    application.properties多环境配置文件、jar包外部配置文件、配置项加密、程序中配置使用
    SpringBoot项目打war包部署Tomcat教程
    spring boot 集成 redis lettuce
    spring boot maven打包可运行jar包
    IDEA项目搭建十四——Web站点Controller基类及布局页静态资源设计
    Nginx Windows详细安装部署教程
    多线程编程CompletableFuture与parallelStream
    IDEA项目搭建十三——服务消费端与生产端通信实现
    【异常】MySQL建表报错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"order"' at line 1
    【警告】mysql链接警告信息:Establishing SSL connection without server's identity verification is not recommended
  • 原文地址:https://www.cnblogs.com/sonictl/p/6735547.html
Copyright © 2011-2022 走看看