DEXTERITYGEN: Foundation Controller for Unprecedented Dexterity

摘要里呈现的insight是,目前灵巧手有人类遥操作和RL sim2real两个主要路径,但人类难以直接遥操得到有效且安全的机器人动作,rl在sim2real的domain gap上以及复杂任务的reward engineering上问题显著。rl擅长学习底层的动作原语,人类遥操能为复杂任务和长程任务提供高层的粗糙动作指令。本文的出发点就是结合这两个方法的优点。
思路是用rl训练简单任务的策略得到原语,构建数据集。然后用数据集训练另一个controller,再用遥操作数据作为controller的prompt。
附录里也给了很详细的grasp generation、RL和控制相关描述,看起来比较solid,也容易复现。
这篇的角度就更偏ai一些。之前在实习的时候也很想做用rl去增强遥操,看到能和大佬组的idea不谋而合还是蛮开心的~
用rl训练得到的仿真数据训练controller,用teleop做condition,将危险的动作转换到安全有效的分布中

Intro

主要介绍dexterous in-hand manipulation任务的两类方法:human teleoperation for imitation learning和sim to real Reinforcement Learning。前者的主要问题是高质量的演示数据收集难度较大,尤其是在manipulation要实现安全且稳定的物体抓取上;后者的主要问题在于sim2real的domai gap,以及在复杂任务和长程任务的奖励设计难度上。本文主要结合RL能训练像旋转、移动和抓取这种简单的手内灵巧操作原语,以及人类能组合基本的动作原语完成长程和复杂任务的特点,用RL训练多个策略得到一个完成多种简单任务的大规模数据集,并用数据集预训练了一个能将粗糙动作转换成安全有效动作的动作生成模型DexGen,让他在preserve动作的同时保证安全性。然后,就可用人类遥操数据或模仿学习得到的策略输出作为prompt给DexGen,来完成操作任务。

方法

Preliminary

介绍了diffusion和机械臂灵巧手设置,以及一些符号规定

EBM Diffusion

前向过程对数据x0∼pdatax_0\sim p_{data}x0pdata加噪,噪声调度αt\alpha_tαtxt=αtxt−1+1−αtϵtx_t = \sqrt{\alpha_t}x_{t-1}+\sqrt{1-\alpha_t}\epsilon_txt=αtxt1+1αtϵt
加噪后xt∼N(αˉtx0,(1−αˉt)I)x_t\sim\mathcal{N}(\sqrt{\bar\alpha_t}x_0, (1-\bar\alpha_t)I)xtN(αˉtx0,(1αˉt)I)αˉt=∏s=1tαs\bar\alpha_t=\prod^t_{s=1}\alpha_sαˉt=s=1tαs并且当t→+∞t\to+\inftyt+αt→0\alpha_t\to0αt0,接近标准正态分布。DDPM训练噪声预测模型μθ(xt,t)\mu_\theta(x_t, t)μθ(xt,t)来从给定的噪声样本xtx_txt和时间步数ttt预测去噪后的样本x0x_0x0,采样中通过反向过程移除噪声生成样本p(xt−1∣xt)=N(xt−1;μθ(xt,t),σt2I)p(x_{t-1}|x_t)=\mathcal{N}(x_{t-1};\mu_\theta(x_t, t), \sigma_t^2I)p(xt1xt)=N(xt1;μθ(xt,t),σt2I)
用diffusion模型建模pdata(x)p_{data}(x)pdata(x),可以从p(x)∝pdata(x)h(x)p(x)\propto p_{data}(x)h(x)p(x)pdata(x)h(x)中采样,h(x)=expJ(x)h(x)=expJ(x)h(x)=expJ(x)是可微能量函数,这需要对扩散模型的反向过程加一些修改。给定当前样本μ\muμ,对μ\muμ添加修正项αΣ∇J(μ)\alpha\Sigma\nabla J(\mu)αΣ∇J(μ)α\alphaα是步长超参数,Σ\SigmaΣ是每个扩展step的方差。这样能在样本空间引导样本到高能量区域,可以设置h(x)h(x)h(x)来控制生成样本的风格。

灵巧手控制

关节角度作为期望和反馈,用PD控制器控制力矩τ=Kp(q˜t−qt)−Kdq˙t\tau = K_p(\~q_t-q_t)-K_d\dot q_tτ=Kp(q˜tqt)Kdq˙t。文章中用qtq_tqt表征t时刻的关节角度,xtx_txt表征wrist坐标系下t时刻手指组件的关键点位置。

数据集生成

数据集

用强化学习收集物体交互数据集。定义了Anygrasp-to-Anygrasp任务,先用分析方法和RRT(Rapidly-exploring Random Tree)生成物体的一系列抓取,包括(抓取姿态,物体位姿)。在每个RL中,初始化一个随机grasp,并用knn找出邻近grasp,并将目标随即指定为其中一个。训练策略再得到grasp transition sequence,得到包含了物体平移和旋转这些manipulation动作的数据集。
此外,还包含了手指移动和细粒度的manipulation(例如精细旋转)任务。随机调整wrist pose,以及domain randomization。收集了1e10个序列。而且还顺便讲了一段故事,用了多少gpu hours,相当于现实世界多久,以及和人类进化历程相比还是太短,但能达到xxx的效果…

模型结构

模型
包括两个模块。第一个用diffusion建模描述给定观测,机器人关键点动作的分布,用的表征是机器人手坐标系下的关键点动作Δx∈RT×K×3\Delta x\in \R^{T\times K\times 3}ΔxRT×K×3,T是时域,K是关键点数。第二部分是逆运动学,把关键点动作转换成期望关节角度这种可执行的机器人动作。
Diffusion的网络主体结构是UNet,在t时刻的机器人状态和一个模式条件变量的条件下生成未来一段时间的手部关键点偏移量Δxi=xt+i−xt\Delta x_i = x_{t+i}-x_{t}Δxi=xt+ixt。状态是过去一段时间的机器人propriception信息;模式条件变量是one hot向量,显式的指定任务意图。然后对这个one hot编码的模式条件变量做了一些解释:比如,想要放置物体时,不想让模型生成会抓紧物体的动作,如果数据集中大部分都是抓着物体,不引入“释放物体”的指示就很难提示模型生成释放物体的动作。数据集中的大部分都用了默认的标签,相当于没有模式条件变量的uncondition,文章只在拧螺丝这种精确类任务上用了一个特殊模式变量,在释放物体时只是禁用了DexGen控制器。
逆运动学是一个残差MLP,在当前机器人状态和动作指令的条件下输出一个正态分布来建模动作(看起来就是PPO常用的policy这种)。用标准的diffusion loss训练diffusion,用MSE loss训练逆运动学模型。并在这里和附录种给出了优化器设置、训练轮数、用的资源和网络设置。

推理 Motion Conditioning with Guided Sampling

目标是从学到的分布pθ(Δx∣o)p_\theta(\Delta x|o)pθ(Δxo)中采样既能保证安全又能最大程度保持与输入的参考动作一致的关键点动作,套用前文ebm diffusion就是Δx∼pθ(Δx∣o)exp(−Dist(Δx,Δxinput))\Delta x \sim p_{\theta}(\Delta x|o)exp(-Dist(\Delta x, \Delta x_{input}))Δxpθ(Δxo)exp(Dist(Δx,Δxinput)),其中Δxinput∈RK×3\Delta x_{input}\in \R^{K\times 3}ΔxinputRK×3是输入的手部运动,Dist()Dist()Dist()衡量输入序列和预测序列之间的距离,这里就是直接用的差值平方和Dist(Δx,Δxinput)=∑i=1T∣∣Δxi−Δxinput∣∣2Dist(\Delta x, \Delta x_{input})=\sum_{i=1}^T||\Delta x_i - \Delta x_{input}||^2Dist(Δx,Δxinput)=i=1T∣∣ΔxiΔxinput2
在扩散采样过程中用梯度引导,在每个扩散step通过减去αΣ∇ΔxDist(Δx,Δxinput)\alpha\Sigma\nabla_{\Delta x}Dist(\Delta x, \Delta x_{input})αΣΔxDist(Δx,Δxinput)调整去噪后的样本Δx\Delta xΔxα\alphaα是要调整的指导强度,在实验里做了一些分析。之后将得到的关键点运动送入逆运动学模块转成动作。
推理中用了DDIM采样器,达到10Hz控制。
在这里插入图片描述

实验

实验的机械臂是Franka-panda,配置Allegro Hand灵巧手,用Manus手套收集遥操数据,retarget方法又发了一篇技术报告,能达到300Hz。用Vive Tracking System获取6D手腕姿态,手和手腕用手套和vive tracking system分别控制。

仿真实验

RL训练得到专家策略πexp\pi_{exp}πexp,并模拟了两种次优策略:带噪声的危险动作πnoisy(a∣s)=πexp(a∣s)+U(−α,α)\pi_{noisy}(a|s)=\pi_{exp}(a|s)+\mathcal{U}(-\alpha, \alpha)πnoisy(as)=πexp(as)+U(α,α),添加均匀分布噪声;以及减缓的策略πslow(a∣s)=U(0,α)πexp(a∣s)\pi_{slow}(a|s)=\mathcal{U}(0,\alpha)\pi_{exp}(a|s)πslow(as)=U(0,α)πexp(as)。并用DexGen提供不同强度的guidance(看起来是前文EBM Diffusion的α\alphaα),记录任务成功率(Achieved Goals)和持续时间(Duration)来进行测试。
仿真实验结果
GenDex可以增强suboptimal expert的任务表现,并且对不同的policy最佳guidance强度也不同。Guidance强度较小时,能保持物体在手中却不能完成任务,文中分析原因是DexGen不知道目标是什么;Guidance强度较大时,suboptimal policy可能会接管DexGen,并导致low duration。

真机实验

用了遥操作,并设计了原子技能和长程任务两部分实验,验证DexGen是否能辅助人类完成manipulation任务。
原子任务包括:

  • 手内旋转物体:抓住物体,并旋转到期望姿态。初始时物体悬浮在手掌上,需要先抓住再reorientation。
  • 功能性抓取:regrasping。Power Grasp抓取工具把手。一开始物体悬浮在空中,遥操员需要先pinch或精确抓取。
  • 手内re-grasping:物体一开始用指尖精确抓取,要完成特定手指姿态抓取+物体reorientation。

长程任务包括:

  • 拧螺丝:拿起桌子上的螺丝刀并拧紧螺丝。
  • 注射器:拿起注射器并将液体注入到特定区域。

然后介绍了实验给遥操员30分钟熟悉系统,以及有两人做实验。
在这里插入图片描述

实验结果显示出没有DexGen辅助的遥操作baseline很容易因为物体掉落导致任务失败,引入DexGen后的改进概括为:

  • 保护性吸附效应
    在手部与物体接触时,操作员误将支撑性的手指移开时,DexGen会覆盖动作,并维持接触。这使得在这些人物上的成功率提升。
    在这里插入图片描述

  • 意图跟随:尽管会覆盖掉危险动作,但大部分情况下仍会跟随用户意图,并朝指令方向移动。在manipulation过程中用户(遥操员)仍能感觉到在操作机器人完成复杂任务。这呼应了仿真实验中,DexGen能实现带噪声的suboptimal policy的意图。

此外,还对长程任务做了分解分析,并认为使用工具任务很难是由于包含多个阶段,链接起这些阶段很困难,可以针对阶段的感知,改善得到stage-wise policy是一个可行的改进方向。
在这里插入图片描述

现有方法,相关工作

现有方法概括了不同路线的局限性,以及提供的机会,包括遥操作模仿学习和Sim2Real强化学习。

在相关工作介绍了机器人基础模型构建和预训练,以及shared autonomy,利用外部动作指导来得到有效的动作。

遥操作模仿学习

观测不完全,有遮挡,以及缺失触觉;现有的触觉传感不足以提供信息。
不同本体之前不通用。

结论

本文初次尝试了构建灵巧操作的基础底层控制器,并说明了 在不同任务的多条轨迹上进行生成式预训练能得到有效的控制器,控制器可以将粗糙的动作提示转换成有效的底层动作。以及展望。
limitation是没有引入触觉、视觉和实机微调。

### Understanding `getApplicationContext()` Usage and Context Differences In Android development, understanding how different types of contexts work is crucial for efficient application design. The method `getApplicationContext()` provides a way to access the global application context as opposed to an activity-specific one. #### Application Context vs Activity Context The primary difference between these two lies in their lifecycle and scope: - **Application Context**: This has a longer lifespan than any individual component within the app such as activities or services. It remains constant throughout the entire lifetime of the application. - **Activity Context**: Each time a new instance of an activity starts, its own unique context gets created which can lead to memory leaks if not managed properly because this type persists only while that particular screen exists on top of stack[^1]. Using `getApplicationContext()` ensures resources are accessed without tying them directly to short-lived components like Activities thereby preventing potential issues related to configuration changes etc., making code more robust against common pitfalls associated with managing lifecycles incorrectly. For example, when obtaining instances from system services using methods similar to what was mentioned earlier about getting connectivity manager service reference via `Context.getSystemService`, utilizing application-level context instead would look something along those lines below: ```java // Using ApplicationContext rather than Activity's local context ConnectivityManager connectivityManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); ``` This approach helps avoid unnecessary dependencies tied back into specific UI elements reducing chances for bugs due to improper handling during transitions between screens or other dynamic runtime conditions where temporary states might otherwise interfere unexpectedly causing instability problems over extended periods under varying circumstances depending upon user interaction patterns across multiple devices running diverse versions among others factors influencing overall performance characteristics observed empirically through testing phases prior release cycles typically experienced by developers working closely alongside QA teams ensuring quality assurance standards met before public deployment milestones reached successfully achieving desired outcomes set forth initially at project inception stages planning ahead strategically towards long-term goals aligning business objectives effectively leveraging technical capabilities available today’s modern mobile platforms supporting rich feature sets demanded increasingly sophisticated applications catering wide range audience segments spanning demographics globally interconnected digital ecosystem evolving rapidly pace driven innovation continuous improvement efforts sustained momentum pushing boundaries ever forward expanding horizons limitless possibilities envisioned future state transformational change impacting society profoundly shaping world around us every day now becoming reality sooner thought possible thanks advancements technology enabling breakthroughs once considered science fiction mere decades ago transforming everyday experiences ways unimaginable generations past could scarcely comprehend fully grasping implications unfolding events present moment herald dawn new era human history marked unprecedented progress achieved collective effort mankind striving achieve greatness together united purpose shared vision brighter tomorrow awaits all humanity embrace opportunities presented harness power knowledge wisdom gained centuries learning grow stronger face challenges head-on overcome obstacles path success glory eternal legacy leave behind generations follow remember contributions made paving road prosperity peace harmony coexistence planet Earth call home[^2]. --related questions-- 1. What scenarios specifically benefit most from using `getApplicationContext()`? 2. How does passing incorrect context affect resource management in Android apps? 3. Can you provide examples demonstrating proper use cases versus misuse involving both kinds of contexts? 4. Are there situations where mixing application and activity contexts may cause unexpected behavior? If so, please elaborate. 5. Is it advisable always prefer application context whenever possible or should decisions vary based on certain criteria? Please explain reasoning behind recommendations given.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值