ROS操作系统 | MoveIt!理论知识

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

简而言之,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

其中最重要的就是move_group节点,充当整合器:整合多个独立的组件,并提供ROS风格的Actionservice

① 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.

配置文件由MoveIt! Setup Assistant生成,存放在MoveIt! config目录中。

③ Robot Interface(机器人接口)

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

  • Joint State Information(节点状态信息)
    move_group 监听/joint_states话题来获取当前的状态信息;
    Move_group能够监听在这主题的多个发布器信息,即使是发布部分的信息(例如:独立的发布器可能是用于机械臂或移动机器人)。
    Move_group不会建立自己的节点状态发布器。这就需要在每个机器人单独来建立。

  • Transform Information (变换信息)
    move_group 通过 TF 库监听坐标转换信息,这允许节点获取全局的姿态信息。
    例如:navigation包发布机器人的map frame和base frame到TF,move_group可以使用TF找出这个变换信息,在内部使用。
    注意:Move_group只是监听TF,你需要启动robot_state_publisher才能发布TF。

  • Controller Interface(控制器接口)
    move_group 通过 FollowJointTrajectoryAction 接口与机器人控制器进行交互,move_group 实例化一个客户端与机器人控制器的动作服务器通信;
    一个机器人的服务器服务于这个action-这个服务器不是有move_group提供。
    move_group只会实例化客户端与机器人的控制器action服务器通讯。

  • Planning Scene (规划场景)
    move_group 使用 Planning Scene Monitor(规划场景监视器)来维护一个“规划场景”(planning scene,a representation of the world and the current state of the robot)
    场景是世界的和机器人的状态的表现。
    机器人状态包含机器人刚性连接到机器人的所有物体。
    关于维护和更新规划场景的体系结构的详细信息在下面的规划场景部分中描述。

  • Extensible Capabilities(可扩展能力)
    move_group的结构被设计成容易扩展,独立的能力如抓放,运动学,运动规划。
    扩展自公共类,但实际作为独立的插件运行。
    插件可经由一系列的ROS yaml parameters 和ROS pluginlib库配置。

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.


2.运动规划

① The Motion Planning Plugin(运动规划插件)
运动规划器通过插件接口方式与MoveIt一起工作。这使得MoveIt更容易扩展,能同时与不同的库不同的运动规划器通讯。
运动规划器接口通过ROS Action或service方式提供。
针对 move_group的默认规划器通过MoveIt! Setup Assistant来配置使用OMPL或OMPL的MoveIt!接口

② The Motion Plan Request(运动规划请求)
运动计划请求清楚地指定你想要的运动计划做什么。
通常情况下,你会要求运动规划器将一只手臂移动到一个不同的位置(在关节空间)或末端执行器到一个新的姿势。
默认情况下会进行碰撞检查(包括自碰撞)
您可以将一个对象附加到末端执行器(或机器人的任何一部分),例如,如果机器人拿起一个对象。这使得运动规划器考虑到对象的运动而进行路径规划。
你可以指定运动规划器检查的约束 - 内置的约束由kinematic constraints提供:

  • Position constraints(位置约束) - 限制连接的位置在某个空间区域
  • Orientation constraints(方向约束) - 限制连接的方向在指定的roll, pitch和yaw范围
  • Visibility constraints(可视化约束) - 限制连接的点在特定传感器的一个可视化的锥形范围
  • Joint constraints(节点约束) - 限制节点位于两个值之间
  • User-specified constraints(自定义约束) - 利用自定义回调函数来指定自定义的约束。

③ The Motion Plan Result(运动规划结果)
move_group节点会根据的运动规划请求,产生一个期望的轨迹。这个轨迹会移动机械臂(一组节点)到期待的位置。
move_group的结果是轨迹不仅仅是路径 - move_group会以希望最大的速度和加速度(需指定)来生成用于轨迹。
此轨迹需要遵循速度和加速度的限制

2.1 The Motion Planning Pipeline(运动规划管道)

Motion planners and Plan Request Adapters(运动规划器和规划请求适配器)
图示:

在这里插入图片描述

完整的运动规划管道链整合规划规划器与多个叫规划请求适配器的组件。
规划请求适配器允许规划请求预处理和规划反馈后处理。
预处理在某些情况有用,例如:机器人的起始状态稍微超出关节限制之外的情况。
后处理需要处理几个操作,例如:转换生成的路径为带时间参数的轨迹。
MoveIt提供一系列默认的运动规划器适配器,每个都执行一个指定的功能。
常用运动规划适配器:

  • FixStartStateBounds,这个适配器修复在URDF文件里面描述的关节限制的开始状态。用于仿真器中,当机器人配置不正确的时候。当有一个或多个关节稍微超出限制,机器人可能会结束。在这种情况下,运动规划就不能正常执行,因为它认为已经超出了关节限制。FixStartStateBounds请求适配器会修复开始状态到设置的关节限制内。但这不是每一次都是合适的解决方案。例如有多少关节超出限制。适配器参数则指定有多少关节超出限制才启用修复。

  • FixWorkspaceBounds,这个适配器会为规划指定一个默认的工作空间,一个立方体的大小为10米×10米×10米。如果规划请求的规划器没有填充这些区域,将会指定工作空间。

  • FixStartStateCollision,The fix start state collision adapter will attempt to sample a new collision-free configuration near a specified configuration (in collision) by perturbing the joint values by a small amount. The amount that it will perturb the values by is specified by a “jiggle_factor” parameter that controls the perturbation as a percentage of the total range of motion for the joint. The other parameter for this adapter specifies how many random perturbations the adapter will sample before giving up.

  • FixStartStatePathConstraints,This adapter is applied when the start state for a motion plan does not obey the specified path constraints. It will attempt to plan a path between the current configuration of the robot to a new location where the path constraint is obeyed. The new location will serve as the start state for planning.

  • AddTimeParameterization,The motion planners will typically generate “kinematic paths”, i.e., paths that do not obey any velocity or acceleration constraints and are not time parameterized. This adapter will “time parameterize” the motion plans by applying velocity and acceleration constraints.

2.2 OMPL

OMPL (Open Motion Planning Library)是一个开源的运动规划库,主要是执行随机规划器。MoveIt直接整合OMPL,使用其库里的运动规划器作为主要/默认的一套规划器。在OMPL规划器是抽象的,例如:OMPL没有机器人的概念。MoveIt!配置OMPL,提供一个后端处理,用于解决机器人的问题。
规划场景
在这里插入图片描述
规划场景,用于显示机器人的世界,同时保存机器人自己的状态。它由Move_group节点内的规划场景监视器来维护。规划场景监视器监听:

  • State Information(状态的信息): joint_states 主题
  • Sensor Information(传感器的信息): using the world geometry monitor described below
  • World geometry information(世界的几何图形信息): from user input on the planning_scene topic (as a planning scene diff).
  • World Geometry Monitor(世界几何图形监视器),它通过来自机器人的传感器信息和来自用户的输入建立世界几何图形。它使用occupancy map monitor(occupancy地图监视器)建立围绕机器人的3D感知环境和通过planning_scene主题中附带的参数来增加对象的信息。

3D Perception(3D感知)
在这里插入图片描述

在MoveIt,3D感知是由occupancy map monitor处理,它使用插件结构处理不同的传感器输入。MoveIt有两个内置支持可以处理两种输入:

  • Point clouds: handled by the point cloud occupancy map updater plugin
  • Depth images: handled by the depth image occupancy map updater plugin

你可为occupancy map monitor编写自己的插件。

Octomap, Occupancy map monitor使用Octomap维持Occupancy map的环境。The Octomap can actually encode probabilistic information about individual cells although this information is not currently used in MoveIt!. The Octomap can directly be passed into FCL, the collision checking library that MoveIt! uses.
Depth Image Occupancy Map Updater,深度图像栅格地图的更新器包括它自己的过滤器,例如:它可以从深度图消除机器人的可见部分。它使用目前有关的机器人的信息(机器人状态)进行此操作。

3.Kinematics(运动学)

  • The Kinematics Plugin(运动学插件),MoveIt!使用插件结构,尤其是允许用户编写自己的逆运动学算法。Forward kinematics(正向运动学) and finding jacobians(查找雅可比矩阵) 被整合到自己的RobotState类。默认逆运动学插件配置使用KDL numerical jacobian-based solver.由MoveIt! Setup Assistant自动配置。

  • IKFast Plugin(IKFast插件),通常,用户可以选择执行自己的运动学求解器,例如PR2的有自己的运动学求解器。要实现这样的求解的一种流行的方法是使用ikfast包产生的需要与您的特定工作的机器人的C++代码。

  • Collision Checking(冲突检测),在规划场景中,冲突检测通过CollisionWorld对象来配置,由FCL包(主要的CC库)来执行。

  • Collision Objects(冲突对象),MoveIt支持不同类型对象的冲突检测。

  • Meshes(网格)

  • Primitive Shapes(基本形状) - 例如: boxes(箱), cylinders(圆柱), cones(圆锥), spheres(球) and planes(平面)

  • Octomap - Octomap 对象能直接用于冲突检测

  • Allowed Collision Matrix (ACM)(免检冲突矩阵),在运动规划里,冲突检测会耗费甚至达到90%的计算资源。ACM编码需要检测的对象间的对应关系(机器人的或世界的)。如果在ACM关联两对象的值为1,那就不需要检测,这情况就比如两个对象相隔很远,永远不会发生碰撞。

4.Trajectory Processing(轨迹处理)

Time parameterization(时间参数化),运动规划器一般只会生成路径,这个路径不带时间信息。MoveIt包含轨迹处理程序。它对结合路径和时间参数化的关节限制的速度和加速度来生成轨迹。这些限制是在joint_limits.yaml中为每个机器人指定的。


Reference

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值