0. MoveIt! 简介

置顶: [ 官网 | 教程 | Github ]

啥是 MoveIt! ?看看官网咋说的:

MoveIt is the most widely used software for manipulation and has been used on over 100 robots. It provides an easy-to-use robotics platform for developing advanced applications, evaluating new designs and building integrated products for industrial, commercial, R&D, and other domains.
By incorporating the latest advances in motion planning, manipulation, 3D perception, kinematics, control and navigation, MoveIt is state of the art software for mobile manipulation.

再来个官方的小片:https://zhuanlan.zhihu.com/p/90784465

简而言之,MoveIt! 就是一个机器人(mobile manipulation)相关的工具集软件,集成了各种 SOTA 库,包括:
  • 运动规划(Motion Planning)
  • 操作(Manipulation)
  • 3D 感知(Perception)
  • 运动学(Kinematics)
  • 碰撞检测(Collision Checking)
  • 控制(Control)
  • 导航(Navigation)
MoveIt! 功能模块

若想要了解 MoveIt! 的历史,可以看一下张新宇老师的ROS史话36篇 | 27. ROS之MoveIt!


1. Moveit! 系统架构

MoveIt! 以 move_group 为核心节点,集成了各种组件,用于 ROS 动作和服务。

Move_group serves as an integrator: pulling all the individual components together to provide a set of ROS actions and services for users to use.

MoveIt! 系统架构

1.1 核心节点 move_group

① User Interface

用户可以使用 move_group 提供的三种方式来处理 actions 和 services:

② Configuration

move_group 通过参数服务器(param server)获取以下信息:

    • URDF:robot_description 参数,获取机器人 URDF 模型信息
    • SRDF:robot_description_semantic参数,获取机器人模型的配置信息,SRDF 是通过 MoveIt Setup Assistant 生成的;
    • MoveIt configuration:机器人的其他配置信息,如关节限位、运动学插件、运动规划插件等,Config files for these components are automatically generated by the MoveIt setup assistant and stored in the config directory of the corresponding MoveIt config package for the robot.

③ Robot Interface

move_group 通过 ROS topics 和 actions 与机器人进行通信,可以获取机器人当前的状态(如关节位置)、获取点云或其他感知数据、与机器人控制器通信等。

    • Joint State Information: move_group 监听 /joint_states话题来获取当前的状态信息;
    • Transform Information: move_group 通过 TF 库监听坐标转换信息,但 move_group 只能监听 TF,若要从机器人发布 TF 信息,必须在机器人上运行 robot_state_publisher节点;
    • Controller Interface: move_group 通过 FollowJointTrajectoryAction 接口与机器人控制器进行交互,move_group 实例化一个客户端与机器人控制器的动作服务器通信;
    • Planning Scene: move_group 使用 Planning Scene Monitor 来维护一个“规划场景”(planning scene,a representation of the world and the current state of the robot)。
MoveIt! 核心节点:move_group


1.2 运动规划器 motion planner

MoveIt! 通过插件机制(plugin interface)与运动规划器(motion planner)进行交互,可以使用多个库的不同运动规划器,使得 MoveIt! 扩展性更强!默认使用的运动规划器是 OMPL(Open Motion Planning Library) 库。

OMPL (Open Motion Planning Library) is an open-source motion planning library that primarily implements randomized motion planners. MoveIt integrates directly with OMPL and uses the motion planners from that library as its primary/default set of planners.
The planners in OMPL are abstract; i.e. OMPL has no concept of a robot. Instead, MoveIt configures OMPL and provides the back-end for OMPL to work with problems in Robotics.
MoveIt! 插件机制

① The Motion Plan Request

做运动规划需要清楚地指明你想让运动规划器做那些事情,可以指定一些约束条件让运动规划去 check。MoveIt! 内置的约束为运动学约束(kinematic constraints),包括:

    • Position constraints:限制 link 的运动区域
    • Orientation constraints:限制 link 的运动方向(roll, pitch, yaw)
    • Visibility constraints:限制 link 上的某点在某区域内的可见性
    • Joint constraints:限制 joint 的运动范围
    • User-specified constraints:用户通过回调函数自定义所需的约束条件

② The Motion Plan Result

move_group 节点将会针对运动规划请求生成期望的轨迹(trajectory not just a path),满足关节速度和加速度限制。完整的运动规划 pipeline 包含运动规划器(motion planner)和规划请求适配器(Plan Request Adapters),如下图所示。

The Motion Planning Pipeline

规划请求适配器(Plan Request Adapters)能够对规划请求做预处理(pre-processing)、对规划响应做后处理(post-processing)。预处理可以应对一些如关节起始状态超出关节限制的场景,后处理可以将生成的路径转成 time-parameterized 轨迹。MoveIt! 提供了一系列默认运动规划适配器,如下所示:

    • FixStartStateBounds:修复 joint 初始极限
    • FixWorkspaceBounds:设置默认尺寸的工作空间
    • FixStartStateCollision:修复碰撞配置文件
    • FixStartStatePathConstraints:找到满足约束的姿态作为机器人的初始姿态
    • AddTimeParameterization:为空间轨迹进行速度、加速度约束,为每个轨迹点加入速度、加速度、时间等参数

1.3 规划场景 Planning Scene

Planning scene 用来表示机器人所处的环境,同时存储了机器人本身的状态。规划场景监测器监听以下话题:

  • State Information:joint_states 话题
  • Sensor Information:
  • World geometry information
The planning sceneis used to represent the world around the robot and also stores the state of the robot itself. It is maintained by the planning scene monitor inside the move_group node.
Planning Scene

1.4 Kinematics

MoveIt! 基于插件机制,允许用户添加自己的逆运动学算法。MoveIt! 默认的逆运动学插件使用的 基于雅克比迭代的数值求解器 KDL,可以通过 MoveIt Setup Assistant 自动配置。

The default inverse kinematics plugin for MoveIt is configured using the KDL numerical jacobian-based solver. This plugin is automatically configured by the MoveIt Setup Assistant.

同时,也可以使用 IKFast 求解器生成 C++ 代码,融入到 MoveIt! 中。

1.5 Collision Checking

MoveIt! 中的碰撞检测是通过 Planning Scene 的 CollisionWorld 对象来配置的,主要是通过 FCL(Flexible Collision Library) 库来实现的。

MoveIt! 支持以下几种物体的碰撞检测:

  • Meshes
  • Primitive Shapes,如 boxes, cylinders, cones, spheres 等
  • Octomap,可以直接用来做碰撞检测

对于运动规划来说,碰撞检测是非常耗时的,通常要占90%的计算时间。Allowed Collision Matrix (ACM) 使用二值化来处理是否需要做碰撞检测,如两个物体相隔很远,永远不会发生碰撞,则在 ACM 中将相应的设为 1 ,表明两个物体不需要做碰撞检测。

1.6 Trajectory Processing

运动规划器通常只生成没有时间信息的路径,而 MoveIt! 通过 trajectory processing routine 来生成 time-parameterized 的轨迹,满足关节速度和加速度的限制,这些限制可以从 joint_limits.yaml文件中读取。


2. MoveIt! 源码

MoveIt! 源码在 ROS Planning 中,包含以下 repos:

  • moveit
    • moveit:Metapackage
    • moveit_core:Core functionality including RobotModel, RobotState, collision checking
    • moveit_ros_planning:planning components, execution manager, plugin loaders
    • moveit_ros_move_group:The move_group main node for using MoveIt via ROS messages
    • moveit_ros_planning_interface:Python and ROS msg interfaces to communicate with move_group
    • moveit_ros_perception: Octomap and other perception plugins
    • moveit_ros_manipulation:High level pick and place pipeline
    • moveit_ros_robot_interaction:Interative marker tools for Rviz
    • moveit_ros_visualization:Rviz tools
    • moveit_ros_warehouse:Database plugins for storing scene and configuration data
    • moveit_ros_benchmarks:Benchmarking using PlannerArena
    • moveit_ros:Metapackage
    • moveit_planners: Metapackage
    • moveit_planners_ompl: Open Motion Planning Library plugin
    • moveit_commander: terminal-based control interface using Python-like syntax
    • moveit_setup_assistant:GUI for quickly setting up MoveIt
    • moveit_plugins: plugins for controller managers
    • chomp_motion_planner: Gradient Optimization Techniques for Efficient Motion Planning
    • chomp_interface: adapter for using CHOMP with MoveIt
  • moveit2 The beta version of MoveIt for ROS 2
  • moveit_msgs ROS messages
  • moveit_task_constructorAn approach to hierarchical, multi-stage manipulation planning
  • moveit_grasps A geometric-based grasp generation library for manipulation
  • moveit_visual_tools display and debugging data in Rviz
  • moveit_resources large file assets such as testing robots
  • moveit_advancedExperimental advanced capabilities
  • moveit_ciscript to run with Travis for continuous integration
  • rqt_moveit Plugin for the GUI framework of ROS, RQT
  • srdfdom Semantic Robot Description Format used exclusively by MoveIt

参考: