V-rep学习笔记:机器人逆运动学解算
IK groups and IK elements
VREP中使用IK groups和IK elements来进行正/逆运动学计算,一个IK group可以包含一个或者多个IK elements:
- IK groups: IK groups group one or more IK elements. To solve the kinematics of a simple kinematic chain, one IK group containing one IK element is needed. The IK group defines the overall solving properties (like what solving algorithm to use, etc.) for one or more IK elements.
- IK elements: IK elements specify simple kinematic chains. One IK element represents one kinematic chain. A kinematic chain is a linkage containing at least one joint object. In short, an IK element is made up by:
- a base (any type of object, even a joint. In that case however the joint is considered as rigid). It represents the start of the kinematic chain.
- several links (any type of object except joints). Joints which are not in IK mode are however also considered as links(in that case they behave as rigid joints (fixed value)).
- several joints. A joint which is not in IK mode is however not considered as a joint, but as a link (see above).
- a tip. The tip is always a dummy and is the last object in the considered kinematic chain (when going from the base to the tip). The tip dummy should be linked to a target dummy (see hereafter) and the link should be an IK, tip-target link type.
- a target. The target is always a dummy and represents the position and/or orientation the tip should adopt (or follow) during simulation.
一个IK element代表一条运动链,最简单的就是下面这种情况,即场景中只有一个串联机械臂(一条运动链),那么进行逆运动学求解只需要一个IK group:
如果同一场景中有2个互不干扰的串联机械臂,那么就需要2个IK group。下面这种情况IK group的求解顺序对结果没有影响:
然而当两个运动链相互之间产生影响时,比如上图中Target2固定到运动链1上时,求解顺序就很重要了。必须先求解IK group1,求解的结果会直接影响Target2的位置,从而影响IK group2的求解:
下面是一种更复杂的情况:两个运动链共享某一关节,先解算运动链1会带着关节朝左移动从而影响运动链2的求解;而先解算运动链2会带着关节朝右移动从而影响运动链1的求解。这种矛盾的情况下按顺序解算就失去作用,需要同时求解两个运动链。将两个IK element放在同一IK group中就可以同时进行逆解计算:
交互式验证求解结果
简单的串联机械臂按照教程很容易搭建好逆运动学模型,模型和求解参数设定好以后可以通过拖拽/旋转Target Dummy(或者操控球)来观察机械臂的行为。下面以帮助文档中的7自由度冗余机械臂为例进行操作,模型位于C:\Program Files\V-REP3\V-REP_PRO_EDU\tutorials\InverseKinematics中。 Try holding down the Ctrl or Shift-keys during manipulation:打开Object Position/Orientation操纵面板,选中操控球(manipSphere),在默认视图下按住鼠标只能在X-Y平面内进行位置的拖拽,如果同时按住Ctrl键则可切换到Z方向拖拽,这是一个很实用的功能。另外值得一提的是下面的Gif图片使用ScreenToGif开源软件制作,相当良心!
打开Tools→User settings对话框,在Object manipulation中也可以自定义拖拽或旋转物体时的步距/步距角:
求解方法
The pseudoinverse tends to have stability problems in the neighborhoods of singularities. At a singularity, the Jacobian matrix no longer has full row rank, corresponding to the fact that there is a direction of movement of the end effectors which is not achievable. If the configuration is exactly at a singularity, then the pseudoinverse method will not attempt to move in an impossible direction, and the pseudoinverse will be well-behaved. However, if the configuration is close to a singularity, then the pseudoinverse method will lead to very large changes in joint angles, even for small movements in the target position.
Try to drag the object as far as possible, and notice how the inverse kinematics task breaks. Indeed, this happens when a configuration is singular or not reachable, however there are workarounds to this behavior: while the simulation is still running, select "IK_Group" in the inverse kinematics dialog list, then specify DLS for the Calc. method item. Drag the object out of reach and notice how the inverse kinematics resolution became more stable. Try adjusting the Damping item up and down. Basically, when damping is large, resolution becomes more stable but slower. The damped least squares method(DLS) avoids many of the pseudo inverse method’s problems with singularities and can give a numerically stable method.
即使用伪逆矩阵法(Pseudo Inverse)进求解,在奇异位置处可能会出现问题,而DLS法在奇异位置处则更稳定。
Practically, you can get the advantages of both resolution methods, all you need to do is define two identical "IK groups", where the first is not damped and the second is damped. Then, for the second "IK group", you can specify a conditional resolution (refer to the Edit conditional parameters item for more information). 伪逆矩阵法收敛快,但是在奇异位置处存在问题;DLS法在奇异位置处计算结果更稳定,但是运算较慢。因此可以将两者结合起来使用,在IK Group中添加undamped的伪逆矩阵法和damped的DLS法。选中damped IK group,点开Edit conditional parameters对话框,在Perform if...条件栏中进行配置:如果undamped方法失败,则执行damped方法。
约束
Make sure that all items are checked in the Constraints section (check als Alpha-Beta and Gamma). Indeed, we want our "tip" dummy to follow our "target" dummy in position and orientation. Sometimes it is however not possible to correctly specify the constraints for a tip, and in that case the IK group's calculation method should be a damped method (e.g. DLS method) with an appropriately selected damping factor. A damped resolution method should also be selected when a target can't possibly be reached (out of reach, or close to a singular configuration). Damping can result in more stable calculations, but keep in mind that damping will always slow down the IK calculations (more iterations will be needed to put the tip into place). 正确理解和施加约束对于运动学逆解的求解相当重要,如果约束的数目比机构自由度要多则会造成过约束,这时有些求解方法就会失败。
在IK element的Constraints选项栏中勾选X、Y、Z可以分别对笛卡尔坐标系下的三个位置分量进行约束,但是姿态的三个分量只有两个选项框可以勾选:Turning Alpha-Beta constraint on, will match the tip's z-axis orientation with the target's z-axis orientation, while keeping a free rotation around the z-axis if Gamma constraint is off. When Alpha-Beta constraint AND Gamma constraint are turned on, then the tip will try to adopt exactly the same orientation as its associated target. (V-rep中物体姿态以X-Y-Z欧拉角的方式确定。即以指定的参考系为初始姿态,然后按X-Y-Z的顺序依次绕自身的坐标轴旋转Alpha,Beta,Gamma角度后得到)
- Alpha-beta on and Gamma off
很多工业机械臂只有4个自由度(包括沿X,Y,Z方向的平移和绕Z轴的旋转自由度),如SCARA机器人,其末端的Z轴指向是固定不变的(因此要约束Alpha-beta,即绕X-Y轴的旋转)。
- Alpha-beta and Gamma on
对于自由度等于或大于6的机械臂,在其灵活工作空间内的点可以任意姿态到达,因此可以约束所有的自由度。
collections
A collection is a user-defined collection of scene objects. A collection has to contain at least one object and is considered to be an entity (objects are also entities). Collections are useful when referring to several objects like a robot for instance. V-REP supports calculations based not only on objects, but also on collections. For instance the collision detection module allows registering following collision pair: (collection A; object B). The collision checking algorithm will then check whether the collection A (any object composing it) collides with object B.
VREP中可以将场景里的物体组成一个集合(collection),后续的一些操作,比如碰撞检测时就可以选取定义好的集合。将物体添加进集合有多种方式,以这个冗余机器人为例,在工具栏中打开Collections对话框,点击Add new collection按钮,添加一个新的集合并将其命名为redundantRob。然后选中机器人的根节点redundantRobot,同时勾选Tree of selected object和Base included,点击Add把机器人整个加入进collection中。为了验证可以点Visualize selected collection按钮,用颜色来显示加入集合中的物体:
VREP提供多种灵活的选取方法(参考帮助文档的Collections页面),上面这种操作只需要选取根节点即可将整个运动链上的物体加入集合,比一个个物体单独添加要方便很多:
In above example, if object 1 is removed from the scene, the element is not valid anymore and will also be removed. Object 1 is the element's defining object.
参考:
Solving IK and FK for any type of mechanism
External kinematics (auxiliary API)
V-rep学习笔记:机器人逆运动学解算的更多相关文章
- expect学习笔记及实例详解【转】
1. expect是基于tcl演变而来的,所以很多语法和tcl类似,基本的语法如下所示:1.1 首行加上/usr/bin/expect1.2 spawn: 后面加上需要执行的shell命令,比如说sp ...
- ES6学习笔记之变量的解构赋值
变量的解构赋值 ES6允许按照一定模式,从数组和对象中提取值,对变量进行赋值,这被称为解构. 数组的解构赋值 以前,为变量赋值,只能直接指定值: 1 2 3 var a = 1; var b = 2; ...
- 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 ...
- V-rep学习笔记:机器人逆运动学数值解法(Cyclic Coordinate Descent Method)
When performing inverse kinematics (IK) on a complicated bone chain, it can become too complex for a ...
- V-rep学习笔记:机器人逆运动学数值解法(Damped Least Squares / Levenberg-Marquardt Method)
The damped least squares method is also called the Levenberg-Marquardt method. Levenberg-Marquardt算法 ...
- Redis学习笔记4-Redis配置详解
在Redis中直接启动redis-server服务时, 采用的是默认的配置文件.采用redis-server xxx.conf 这样的方式可以按照指定的配置文件来运行Redis服务.按照本Redi ...
- Android学习笔记之Activity详解
1 理解Activity Activity就是一个包含应用程序界面的窗口,是Android四大组件之一.一个应用程序可以包含零个或多个Activity.一个Activity的生命周期是指从屏幕上显示那 ...
- [C#] 类型学习笔记二:详解对象之间的比较
继上一篇对象类型后,这里我们一起探讨相等的判定. 相等判断有关的4个方法 CLR中,和相等有关系的方法有这么4种: (1) 最常见的 == 运算符 (2) Object的静态方法ReferenceEq ...
- V-rep学习笔记:机器人逆运动学数值解法(The Jacobian Transpose Method)
机器人运动学逆解的问题经常出现在动画仿真和工业机器人的轨迹规划中:We want to know how the upper joints of the hierarchy would rotate ...
随机推荐
- 基于DPI(深度报文解析)的应用识别
一.概述 1.DPI(Deep packet inspection,深度报文解析) 所谓“深度”是和普通的报文分析层次相比较而言的,“普通报文检测”仅分析IP包4 层以下的内容,包括源地址.目的地址. ...
- Zookeeper Tutorial 2 -- Programmer's Guide
数据模型 ZooKeeper跟分布式文件系统一样, 有一系列的命名空间. 唯一不同的地方是命名空间中的每个节点都有数据和他相关联. 它类似于一个允许文件同时是一个目录的文件系统. 节点的路径永远是以斜 ...
- MVC详解(转)
原文链接:MVC详解 MVC与模板概念的理解 MVC(Model View Controller)模型-视图-控制器 MVC本来是存在于Deskt op程序中的,M是指数据模型,V是指用户界面,C ...
- 使用Git Submodule管理子模块
转自:https://segmentfault.com/a/1190000003076028 使用场景 基于公司的项目会越来越多,常常需要提取一个公共的类库提供给多个项目使用,但是这个library怎 ...
- [leetcode]Median of Two Sorted Arrays @ Python
原题地址:https://oj.leetcode.com/problems/median-of-two-sorted-arrays/ 题意:There are two sorted arrays A ...
- 如何确定一个NFS的mount是v3还是v4?
命令如下: nfsstat –m nfsstat –m | grep /home/mymnt 参考资料 ============ https://unix.stackexchange.com/ques ...
- CentOS 6和CentOS 7防火墙的关闭
CentOS6.5查看防火墙的状态: 1 [linuxidc@localhost ~]$service iptable status 显示结果: 1 2 3 4 5 [linuxidc@localho ...
- group by 深入总结(转)
http://www.cnblogs.com/wangtao_20/archive/2011/02/23/1959792.html 一.不兼容的语法问题. 先看使用如下sql:SELECT count ...
- 转: git使用时让http记住帐号密码
见 http://git.mydoc.io/?t=154710 https 方式每次都要输入密码,按照如下设置即可输入一次就不用再手输入密码的困扰而且又享受 https 带来的极速 按照以下设置记住密 ...
- unity中使用自定义shader进行光照贴图烘培无法出现透明度的坑爹问题
最近开发中在对场景进行光照贴图烘焙时发现一个坑爹问题,在使用自定义shader的时候,shader命名中必须包含Transparent路径,否则烘焙的时候不对alpha通道进行计算,烘焙出来都是狗皮膏 ...