zoukankan      html  css  js  c++  java
  • 6.20-Param reconfig讨论

    TOC

    参考

    ROS WIKI
    dynamic_reconfigure

    前言

    • 因为windows平台的ROS for LV 没有显式支持action,所以不能直接给move_base节点发送move_base/cancel (actionlib_msgs/GoalID),故在ROS端添加一个Proxy来代理解决
    • 该代理的功能还包括ROSARIA和move_base的reconfigure,所以要从命令行运行重新配置命令
    • 还修正一个ROSARIA发送的pose_msg内容为相对坐标的问题,改为发送相对于zsWorld坐标系的绝对坐标(在rosaria包中完成)
    • 以后还可以承担打开和关闭各个节点的任务!

    工作

    1. ROSARIA坐标修正,并制作一个reconfiguration_server(在rosaria包中完成)
    2. 接收上级节点发送的取消service_call,转发给move_base取消action_msg
    3. 接收来自上级节点的move_base reconfigure_msg,运行命令行进行重新配置
    4. 接收来自上级节点的rosaria reconfigure_msg,运行命令行进行重新配置
    5. 接收来及上级节点的重新定位的msg,运行命令行重新配置tf,主要是zsWorld与odom的坐标系转换关系
    6. 确认ROS for LV与ROS的连接关系
    7. 用rosaria_client进行测试

    步骤

    坐标修正

    • 建立一个包
    catkin_create_pkg zsProxy std_msgs roscpp
    • 修改vscode 配置文件c_cpp_properties.json
    subl ./.vscode/c_cpp_properties.json
    {
                "name": "Linux",
                "includePath": ["/usr/include",
                "/opt/ros/indigo/include",
                "${ROS_PACKAGE_PATH}",
                "/opt/ros/kinetic/include"]
    },
    • 修改 .gitignore,vscode的数据文件就不要上传了
    .vscode/

    学习dynamic config

    • 关于参数概念的详细讨论

      主要有两种访问参数的方法,一种是参数服务器,生命周期随roscore;另外一种就是动态重新配置参数,可以在程序运行时进行重新配置参数

    • 关于参数具体实现和模式的讨论

      In roslaunch files, tags are for setting a single parameter and tags are for setting groups or more complex structures of parameters.
      The value set by the tag may only be a string, int, bool, or double, which may be set through the xml attribute value, or by reading in from a text file, bin file, or the output of a command line command.
      The tag enables users to define a batch of related parameters simultaneously. These can be read from a YAML string which can either be put inline in the launchfile or can be loaded from a file (the rosparam dump command generates YAML output). Unlike the tag, the YAML specification allows nested structures of parameters and parameters with list values. While these data can be represented on the ROS parameter server, it is up to the various client libraries to support complex parameter access.
      A good example of the tag use in practice is the move_base package, where there are many, many parameters to be set, it's less cumbersome to just use the YAML format.

    dynamic reconfig具体技术

    Service Call-Based Re-configuration 实践

    • 使用上面所述第二种方法,使用命令行执行,可以在shell中执行,不过最好在C++中执行
    rosrun dynamic_reconfigure dynparam set /<node_name> <param> <value>
    system("rosrun dynamic_reconfigure dynparam set camera_synchronizer_node narrow_stereo_trig_mode 3");

    关于dynparam更详细的用法

  • 相关阅读:
    11 对象的构造
    10 问题分析一
    9 新型的类型转换
    8 C++ 中的新成员
    7 函数重载
    6 函数参数的扩展
    5 内联函数
    查找算法总结Java实现
    九大排序算法Java实现
    帝国cms所有一级栏目遍历,如果有子栏目的话,遍历出来
  • 原文地址:https://www.cnblogs.com/lizhensheng/p/11117575.html
Copyright © 2011-2022 走看看