参考
前言
工作
步骤
坐标修正
学习dynamic config
dynamic reconfig具体技术
Service Call-Based Re-configuration 实践
TOC
参考
前言
- 因为windows平台的ROS for LV 没有显式支持action,所以不能直接给move_base节点发送move_base/cancel (actionlib_msgs/GoalID),故在ROS端添加一个Proxy来代理解决
- 该代理的功能还包括ROSARIA和move_base的reconfigure,所以要从命令行运行重新配置命令
- 还修正一个ROSARIA发送的pose_msg内容为相对坐标的问题,改为发送相对于zsWorld坐标系的绝对坐标(在rosaria包中完成)
- 以后还可以承担打开和关闭各个节点的任务!
工作
- ROSARIA坐标修正,并制作一个reconfiguration_server(在rosaria包中完成)
- 接收上级节点发送的取消service_call,转发给move_base取消action_msg
- 接收来自上级节点的move_base reconfigure_msg,运行命令行进行重新配置
- 接收来自上级节点的rosaria reconfigure_msg,运行命令行进行重新配置
- 接收来及上级节点的重新定位的msg,运行命令行重新配置tf,主要是zsWorld与odom的坐标系转换关系
- 确认ROS for LV与ROS的连接关系
- 用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/
- 试用完vscode之后,发现还是CLion IDE爽,配合git 使用需要做一下特殊设置,不然可能会出现无法访问远程仓库问题
settings-->Version Control-->Git ,and then, In the SSH executable dropdown, choose Native
- 修改rosaria包,增加zs_pose_msg
- 接下来修改reconfiguration server及配置
学习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具体技术
- 窗口程序界面下的重新配置,实际上这是标准的重新配置界面,见rqt_reconfigure
- 另外就是使用dynparam command-line tool
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");
原文地址:https://www.cnblogs.com/lizhensheng/p/11117575.html