最新消息:

MoveIt!入门教程-压力测试(Benchmarking)

Arm/机械臂套件 少儿编程 1597浏览 0评论
MoveIt!入门教程

MoveIt!入门教程-压力测试(Benchmarking)

说明

  • 这是新的压力测试方法,对于ROS版本Kinetic及之后版本有效。
  • 要使用这个压力测试方法,你要下载ROS的Warehouse插件,目前不适用debian系列的系统,并要求源码安装。
  • 一些源码介绍参考
  • benchmarking 包提供方法压力测试运动规划算法和利用OMPL Planner Arena聚合/绘图统计。
  • 下面例子演示如何在Fanuc M-10iA运行压力测试。

例子

  • 一个例子提供在examples目录,launch文件要求MoveIt Fanuc M-10iA 的配置包 ,这可下载

  • 启动Fanuc M-10iA demo.launch

    roslaunch moveit_resources demo.launch db:=true

  • 在Rviz插件的Motion Planning,Context选项,点击Connect按钮连接到数据库。

  • 保存一个场景到Stored Scenes选项,双击列表的场景,命名为Kitchen1 。

  • 通过interactive markers移动Fanuc M-10iA的开始和目标状态。

  • 为Kitchen1 场景保存一个名为Pick1的查询

  • 同样在Stored States选项保存一个机器人的开始状态,名为Start1

  • 正确配置moveit_ros/benchmarks/examples/demo1.yaml涉及的 the scenes, queries and start states部分

  • 通过ctrl+c关闭之前的launch文件

  • 变更当前目录到output_directory,导出压测配置的文件

rosed moveit_ros_benchmarks demo_fanuc.launch
  • 运行压力测试
roslaunch moveit_ros_benchmarks demo_fanuc.launch

查看结果:

  • 压力测试执行,很多参数会被收集和写入日志文件。
  • moveit_benchmark_statistics.py文件可以分析这些数据,并通过绘图显示这些统计信息。
rosrun moveit_ros_benchmarks moveit_benchmark_statistics.py <path_of_logfile>
  • 生成PDF版本
python -p <plot_filename> moveit_benchmark_statistics.py <path_of_logfile>
  • 或上传 moveit_benchmark_statistics.py生成的数据库文件到plannerarena.org网站,可交互式可视化结果。

BenchmarkOptions类的参数

  • 这个类从 ROS parameter server读取压力测试需要的参数和选项。
  • 参数格式:
benchmark_config:

  warehouse:
      host: [hostname/IP address of ROS Warehouse node]                           # Default localhost
      port: [port number of ROS Warehouse node]                                   # Default 33829
      scene_name: [Name of the planning scene to use for benchmarks]              # REQUIRED

  parameters:
      runs: [Number of runs for each planning algorithm on each request]          # Default 10
      group: [The name of the group to plan]                                      # REQUIRED
      timeout: [The maximum time for a single run; seconds]                       # Default 10.0
      output_directory: [The directory to write the output to]                    # Default is current working directory

      start_states: [Regex for the stored start states in the warehouse to try]   # Default ""
      path_constraints: [Regex for the path constraints to benchmark]             # Default ""

       queries: [Regex for the motion plan queries in the warehouse to try]        # Default .*
       goal_constraints: [Regex for the goal constraints to benchmark]             # Default ""
       trajectory_constraints: [Regex for the trajectory constraints to benchmark] # Default ""

      workspace: [Bounds of the workspace the robot plans in.  This is an AABB]   # Optional
          frame_id: [The frame the workspace parameters are specified in]
          min_corner: [Coordinates of the minimum corner of the AABB]
              x: [x-value]
              y: [y-value]
              z: [z-value]
          max_corner: [Coordinates of the maximum corner of the AABB]
              x: [x-value]
              y: [y-value]
              z: [z-value]

  planners:
      - plugin: [The name of the planning plugin the planners are in]             # REQUIRED
        planners:                                                                 # REQUIRED
          - A list of planners
          - from the plugin above
          - to benchmark the
          - queries in.
      - plugin: ...
          - ...

BenchmarkExecutor类的参数:(此部分的翻译感觉不太正确,建议看英文自己理解,或有指正请联系我1043931)

  • 这个类创建MotionPlanRequests集合,被给的相关参数是实例化BenchmarkOptions所支持的,再执行规划器指定的每个请求。

  • 来自BenchmarkOptions的queries, goal_constraints和trajectory_constraints是当作独立的query

  • 如果start_states集合被指定,每个查询,goal_constraint和trajectory_constraint都会尝试每个开始状态(现有来自查询的开始状态会被忽略)

  • 类似的,路径约束集合合并的start query和start goal_constraint 配对组合(现有来自query的path_constraint会被忽略)

  • 工作空间如果被指定,会覆盖任何现有工作空间的参数。

  • 压力测试管道不使用MoveGroup,PlanningRequestAdaptors不会被调用。

  • 可以通过BenchmarkExecutor类重写一个或多个虚函数进行自定义的压力测试,此外存在一组函数让派生定制更容易。

    • preRunEvent: invoked immediately before each call to solve
    • postRunEvent: invoked immediately after each call to solve
    • plannerSwitchEvent: invoked when the planner changes during benchmarking
    • querySwitchEvent: invoked before a new benchmark problem begin execution
  • Note, in the above, a benchmark is a concrete instance of a PlanningScene, start state, goal constraints / trajectory_constraints, and (optionally) path_constraints. A run is one attempt by a specific planner to solve the benchmark.

您必须 登录 才能发表评论!