Solving the FK problem of simple kinematic chains is trivial (just apply the desired joint values to all joints in the chain to obtain the position and orientation of the tip or end effector). However it is less trivial to solve the IK and FK problem for closed mechanisms. 计算串联机构(或开链机构)的运动学正解很简单,但是对于并联机构或者闭链机构(若运动链的各构件构成了首末封闭的系统,则称其为闭式运动链)来说运动学正解的计算就比较复杂。

Solving IK and FK for closed mechanisms

  In the case of an FK problem, identify the joints that you want to control (i.e. the joints that are driving the mechanism, the active joints—select the joint mode different from inverse kinematics mode). Then, identify which kinematic chain needs to be closed. Closing will be handled by loop closure constraints in the form of tip-target pairs as shown in following figure:

[Forward Kinematics solving method for closed mechanisms]

  Then, set the desired joint values for the active joints and call the inverse kinematics functionality to handle loop closure constraints. (the default main script handles all IK groups that are not marked as explicit handling). Following example shows some additional functionality that can be used to solve complicated kinematic problems:

[Inverse kinematics task]

  Most of the time there are several different ways of solving the IK or FK of a mechanism, and it is always worth considering various alternatives before implementing the most complicated one!

  参考V-REP_PRO_EDU\scenes\ik_fk_simple_examples\7-fkAndIkResolutionForParallelMechanisms.ttt中的例子,实现了闭链机构的运动学正解与逆解:

  根据这个例子我们来搭建一个平行四边形机构。构建树形层级结构:以frame作为机座,然后将运动链上的节点依次串联起来,最后将target和tip连接起来构成闭环(loop closure)。target和tip的类型设置为IK,tip-target,然后在Calculation Modules的IK选项卡中添加IK group,并将其设为显式处理(Explicit handling):

[模型结构]

[IK设置]

  给第一个关节(主动控制关节。其它关节从动但要设为IK模式,而不是passive模式)施加一个正弦规律的往复摆动,可以看出机构能跟着一起运动而不散开。添加Graph记录末端关节转角和运动链上倒数第二个关节的转角,可以看出末端关节转角为0且始终保持不变(其实这里末端的Joint并没有什么作用,因为在IK的计算下tip和target已经能重合。比如上面官方的那个例子中最后一根杆L5就没有接Joint而是直接连着tip)。

  代码如下,在设置主动关节角度后可以调用simHandleIkGroup函数来计算IK,使机构保持闭环:

if (sim_call_type==sim_childscriptcall_initialization) then

    ikGroup=simGetIkGroupHandle('ik')
tipDummy=simGetObjectHandle('tip')
motor=simGetObjectHandle('Revolute_joint0') -- set the motor joint into ik mode
simSetJointMode(motor,sim_jointmode_ik,) -- close the mechanism (if it was open)
simHandleIkGroup(ikGroup)
end if (sim_call_type==sim_childscriptcall_actuation) then -- First set the motor joint into passive mode
simSetJointMode(motor,sim_jointmode_passive,) -- Set the desired joint angle
local angle=*math.pi/*math.sin(math.pi*simGetSimulationTime())
simSetJointPosition(motor, angle) -- Compute
simHandleIkGroup(ikGroup)
end

  

  注意使用几何约束求解器GCS也能实现类似的功能,只是相比IK存在着一些差异:The geometric constraint solver is slower and less precise at solving kinematic problems, but might be easier and more intuitive to use. Moreover, it allows interacting with a mechanism in a more flexible way than the inverse kinematics calculation module.

  下面场景中可以拖拽机构上的任意杆件来直观地控制其运动。这里使用的是Geometric Constraint Solver(注意要设置好General damping参数,否则可能出现拖拽时机构不动、动的很迟缓或者约束broken的现象)

参考:

Solving IK and FK for any type of mechanism

V-rep学习笔记:机器人逆运动学解算

V-rep学习笔记:Geometric Constraint Solver(几何约束求解)

V-rep学习笔记:并联机构正逆运动学的更多相关文章

  1. V-rep学习笔记:机器人逆运动学解算

    IK groups and IK elements VREP中使用IK groups和IK elements来进行正/逆运动学计算,一个IK group可以包含一个或者多个IK elements: I ...

  2. V-rep学习笔记:机器人逆运动学数值解法(Cyclic Coordinate Descent Method)

    When performing inverse kinematics (IK) on a complicated bone chain, it can become too complex for a ...

  3. V-rep学习笔记:机器人逆运动学数值解法(Damped Least Squares / Levenberg-Marquardt Method)

    The damped least squares method is also called the Levenberg-Marquardt method. Levenberg-Marquardt算法 ...

  4. V-rep学习笔记:机器人逆运动学数值解法(The Jacobian Transpose Method)

    机器人运动学逆解的问题经常出现在动画仿真和工业机器人的轨迹规划中:We want to know how the upper joints of the hierarchy would rotate ...

  5. V-rep学习笔记:机器人逆运动学数值解法(The Pseudo Inverse Method)

    There are two ways of using the Jacobian matrix to solve kinematics. One is to use the transpose of ...

  6. python 学习笔记 10 -- 正則表達式

    零.引言 在<Dive into Python>(深入python)中,第七章介绍正則表達式,开篇非常好的引出了正則表達式,以下借用一下:我们都知道python中字符串也有比較简单的方法, ...

  7. shell脚本学习笔记 (正則表達式)

    正則表達式一般有三个部分组成,他们各自是:字符类,数量限定符,位置限定符. 规定一些特殊语法表示字符类.数 量限定符和位置关系,然后用这些特殊语法和普通字符一起表示一个模式,这就是正則表達式(Regu ...

  8. C#学习笔记---协变和逆变

    http://www.cnblogs.com/alphafly/p/4048608.html 协变是指方法能从委托的返回类型派生的一个类型. 逆变之方法获取的参数可以是委托参数类型的基类.

  9. V-rep学习笔记:Geometric Constraint Solver(几何约束求解)

    The geometric constraint solver is slower and less precise at solving kinematic problems, but might ...

随机推荐

  1. C# WebBrowser控件使用整理

    一.简介 WebBrowser 控件为 WebBrowser ActiveX 控件提供了托管包装. 托管包装使您可以在 Windows 窗体客户端应用程序中显示网页. 使用WebBrowser 控件, ...

  2. delete method not allowed 405错误

    造成该问题的原因:iis版本问题 解决办法如下: 修改配置文件web.config <system.webServer><modules><remove name=&qu ...

  3. android中解决“Dex Loader] Unable to execute dex: Multiple dex files define LXXX”错误

    原因 1. 出现这种问题的主要原因:那就是你的libs下面引用了两个相同功能的包,可能这两个包的版本不一样而已,去掉一个吧,选择一个合适的版本. 2.build path里面包重复引用.

  4. POJ 1451 T9 (字典树好题)

    背景:为了方便九宫格手机用户发短信,希望在用户按键时,根据提供的字典(给出字符串和频数),给出各个阶段最有可能要打的单词. 题意: 首先给出的是字典,每个单词有一个出现频率.然后给出的是询问,每个询问 ...

  5. js 处理URL实用技巧

    escape().encodeURI().encodeURIComponent()三种方法都能对一些影响URL完整性的特殊字符进行过滤.     但后两者是将字符串转换为UTF-8的方式来传输,解决了 ...

  6. windows 使用 xxfpm 解决 php-cgi 进程自动关闭

    windows 下 php-cgi 进程处理一定数量的访问后,就会自动关闭,由于没办法直接让 php-cgi 进程支持更多的访问数量,所以只能启动多个进程来满足需求. xxfpm 是一个可执行程序,它 ...

  7. tf.concat, tf.stack和tf.unstack的用法

    tf.concat, tf.stack和tf.unstack的用法 tf.concat相当于numpy中的np.concatenate函数,用于将两个张量在某一个维度(axis)合并起来,例如: a ...

  8. ASP.NET MVC 重命名[命名空间]而导致的错误及发现的ASP.NET MVC Bug一枚

    使用VS2012新建了一个Asp.net mvc5的项目,并把项目的命名空间名称更改了(Src更改为UXXXXX),然后就导致了以下错误 刚开始以后是项目的属性中的命名空间没有更改过来的问题,但我在重 ...

  9. ASP.NET MVC 基于页面的权限管理

    菜单表 namespace AspNetMvcAuthDemo1.Models { public class PermissionItem { public int ID { set; get; } ...

  10. HK Openstack Summit 归来有感

    4天的Icehouse openstack Summit终于结束,从香港又回到了北京,我们的产品反响相当不错,吸引了很多的注意力和商谈.可是实际上我最近过得很憋屈,心灰意冷,没有了当初那么拼命的动力. ...