【moveit1】 MoveIt 任务构建器 MoveIt Task Constructor

MoveIt任务构造器简介
MoveIt任务构造器提供了一种灵活透明的方式定义和规划由多个相互依赖的子任务组成的操作。它通过容器对基本阶段进行分层组织,支持顺序和并行组合。此外,还介绍了生成器、传播器和连接器等核心概念。

MoveIt Task Constructor — moveit_tutorials Noetic documentation

../../_images/mtc_example.png

 

任务构造器框架The Task Constructor framework提供了一种灵活透明的方式来定义和规划由多个相互依赖的子任务组成的操作。 它利用 MoveIt 的规划功能来解决黑盒规划阶段的各个子问题。 基于 MoveIt 的 PlanningScene 的通用接口common interface用于在阶段之间传递解决方案假设。 该框架支持使用容器对基本阶段进行分层组织,允许顺序和并行组合。 有关更多详细信息,请参阅相关的 ICRA 2019 出版物。

 Installing MoveIt Task Constructor

Install From Source

进入您的 catkin 工作区并在必要时初始化 wstool(假设 ~/ws_moveit 作为工作区路径):

cd ~/ws_moveit/src
git clone https://github.com/ros-planning/moveit_task_constructor.git

使用 rosdep 安装缺少的包:

rosdep install --from-paths . --ignore-src --rosdistro $ROS_DISTRO

构建工作区:

cxy@ubuntu:~/ws_moveit$ catkin_make -DCATKIN_WHITELIST_PACKAGES="moveit_task_constructor"

Running the Demo

MoveIt 任务构造器包包含几个基本示例和一个拾放演示。 对于所有演示,您应该启动基本环境:

roslaunch moveit_task_constructor_demo demo.launch

随后,您可以运行各个演示:

rosrun moveit_task_constructor_demo cartesian

MoveIt 任务构建器笛卡尔运动

rosrun moveit_task_constructor_demo modular

MoveIt 任务构建器模块化的笛卡尔运动

roslaunch moveit_task_constructor_demo pickplace.launch

moveit任务构建器 运动规划任务pickplace

在右侧,您应该会看到 Motion Planning Tasks 面板,其中概述了任务的分层阶段结构。 当您选择特定阶段时,成功和失败的解决方案列表将显示在最右侧的窗口中。 选择这些解决方案之一将开始其可视化。

../../_images/mtc_show_stages.gif

 

Basic Concepts

MTC 的基本思想是复杂的运动规划问题可以组合成一组更简单的子问题。 顶层规划问题被指定为任务Task ,而所有子问题都由阶段Stages指定。 阶段可以按任意顺序排列,层次结构仅受各个阶段类型的限制。 阶段的排列顺序受结果传递方向的限制。 与结果流result flow相关的三个可能阶段:生成器、传播器和连接器阶段:generator, propagator, and connector stages

Generators compute their results independently of their neighbor stages and pass them in both directions, backwards and forwards. An example is an IK sampler for geometric poses where approaching and departing motions (neighbor stages) depend on the solution.

生成器独立于它们的邻居阶段neighbor stages 计算它们的结果,并在两个方向上,向后和向前传递它们。 一个例子是几何poses的 IK 采样器,其中接近和离开运动approaching and departing motions(neighbor stages)取决于解决方案。  

Propagators receive the result of one neighbor stage, solve a subproblem and then propagate their result to the neighbor on the opposite site. Depending on the implementation, propagating stages can pass solutions forward, backward or in both directions separately. An example is a stage that computes a Cartesian path based on either a start or a goal state.

传播器接收一个相邻阶段的结果,解决一个子问题,然后将他们的结果传播到另一相邻阶段。 根据实现,传播阶段可以分别向前、向后或双向传递解决方案。 一个例子是基于开始或目标状态计算笛卡尔路径的阶段。

Connectors do not propagate any results, but rather attempt to bridge the gap between the resulting states of both neighbors. An example is the computation of a free-motion plan from one given state to another.

Additional to the order types, there are different hierarchy types allowing to encapsulate subordinate stages. Stages without subordinate stages are called primitive stages, higher-level stages are called container stages. There are three container types:

连接器不会传播任何结果,而是试图弥合两个相邻的结果状态之间的差距。 一个例子是计算从一个给定状态到另一个给定状态的(避障运动)自由运动规划。

除了订单类型之外,还有不同的层次结构类型允许封装从属阶段。 没有从属阶段的阶段称为primitive stages原始阶段,更高级别的阶段称为容器阶段 container stages。 共有三种容器类型:

Wrappers encapsulate a single subordinate stage and modify or filter the results. For example, a filter stage that only accepts solutions of its child stage that satisfy a certain constraint can be realized as a wrapper. Another standard use of this type includes the IK wrapper stage, which generates inverse kinematics solutions based on planning scenes annotated with a pose target property.

Serial Containers hold a sequence of subordinate stages and only consider end-to-end solutions as results. An example is a picking motion that consists of a sequence of coherent steps.

Parallel Containers combine set of subordinate stages and can be used for passing the best of alternative results, running fallback solvers or for merging multiple independent solutions. Examples are running alternative planners for a free-motion plan, picking objects with the right hand or with the left hand as a fallback, or moving the arm and opening the gripper at the same time.

Wrappers 包装器封装单个从属阶段并修改或过滤结果。 例如,仅接受满足特定约束的子阶段的解决方案的过滤器阶段可以实现为包装器。 这种类型的另一个标准用途包括 IK 包装器阶段,它基于使用姿势目标属性注释的规划场景生成逆运动学解决方案。

Serial Containers串行容器包含一系列从属阶段,并且仅将端到端解决方案视为结果。 一个例子是由一系列连贯步骤组成的拾取运动

Parallel Containers并行容器组合了一组从属阶段,可用于传递最佳替代结果、运行回退求解器或合并多个独立解决方案。 例如,为自由(避障)运动计划运行替代规划器,用右手或左手拾取物体作为后备,或同时移动手臂并打开抓手。

../../_images/mtc_stage_types.png

 

阶段不仅支持解决运动规划问题。 它们还可用于各种状态转换,例如修改规划场景。 结合使用类继承的可能性,可以构建非常复杂的行为,而只依赖于结构良好的原始阶段集。

### 关于 MoveIt Task Constructor 的介绍 MoveIt 是一个用于机器人运动规划的强大框架,而 **MoveIt Task Constructor (MTC)** 则是一个扩展模块,旨在通过提供高层次的任务抽象来简化复杂任务的构建过程。它允许开发者定义一系列子任务并将其组合成完整的任务序列。 以下是关于 MTC 的一些核心概念及其文档资源: #### 官方文档与教程 官方提供了详细的文档和教程,帮助用户快速入门 MTC 并掌握其功能[^3]。这些资料涵盖了从基础到高级的各种主题,包括但不限于: - 子任务(Subtasks)的概念以及如何创建自定义子任务。 - 如何将多个子任务串联起来形成复杂的任务链。 - 使用条件分支实现动态行为调整的方法。 - 集成传感器数据和其他外部输入的能力。 对于初学者来说,可以从以下链接访问最新的在线文档和示例代码库[^4]: ```plaintext https://moveit-task-constructor.readthedocs.io/ ``` 此外,在 GitHub 上也有专门维护的一个存储库包含了丰富的演示程序和测试场景供参考学习之用[^5]: ```plaintext https://github.com/moveit/moveit_task_constructor/tree/main/tutorials ``` #### 社区支持与其他资源 除了上述提到的正式渠道外,还可以关注 ROS 论坛或者 Stack Overflow 中有关 `moveit` 和 `mtc` 标签下的讨论帖获取更多实践经验分享;同时也可以尝试订阅相关邮件列表以便及时获得最新进展通知[^6]。 ```python import moveit_task_constructor as mtc # 创建一个新的任务对象 task = mtc.Task() # 添加第一个子任务 - 移动至目标位置 pick_subtask = task.add("Pick", {"object": "box"}) place_subtask = task.add("Place", {"location": "table"}) # 设置依赖关系使得放置动作发生在拾取之后 task.connect(pick_subtask, place_subtask) print(task.serialize()) ``` 以上片段展示了如何利用 Python API 来设计简单的抓放操作流程[^7]。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值