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

IK Solutions:

  • Analytical solutions are desirable because of their speed and exactness of solution.
  • For complex kinematics problems, analytical solutions may not be possible.
  • Use iterative methods (迭代法)--Optimization methods (e.g., minimize the distance between end effector and goal point)

  机器人学的教材上一般只介绍了运动学逆解的解析解法,很少涉及数值解(迭代解法)。其中有两方面的原因,一是数值解相对于解析解需要的运算量更大,不太适合实时性要求较高的场合;另一方面是因为一般在设计机器人的结构时就会考虑其逆解的可解性,比如相邻的三个关节轴线相交即存在解析解。下面以最简单的二连杆机构为例子,研究一下机器人运动学逆解的数值解法。如下图所示,其运动学正解很容易得到,根据运动学正解可以写出机器人的雅克比矩阵J

What is Jacobian? A linear approximation to f(x). 雅克比矩阵相当于函数f(x)的一阶导数,即线性近似。

Computing the Jacobian Numerically:(雅克比矩阵的计算有解析法和数值法,当难以根据解析法得到雅克比时可以用差分法代替微分求解)

下面是Jacobian Transpose方法的主要推导过程:

  It is recommended that you choose a small positive scalar α < 1 and update the joint angles θ by adding Δθ. Then proceed iteratively by recomputing the Jacobian based on the updated angles and positions, finding new values for Δθ and again updating with a small fraction α. This is repeated until the links are sufficiently close to the desired positions. The question of how small α needs to be depends on the geometry of the links; it would be a good idea to keep α small enough so that the angles are updated by at most 5 or 10° at a time.

  这一方法运用了最速降法(梯度法)的思想,利用目标函数在迭代点的局部性态,每步搜索都沿着函数值下降最快的方向,即负梯度方向进行搜索。迭代过程的几何概念较为直观,方法和程序简单,容易实现,不足之处是每次迭代都是沿着迭代点的负梯度方向搜索,搜索路径较为曲折,收敛慢。

Operating Principle:  

Project difference vector DX on those dimensions qwhich can reduce it the most. It is a plausible, justifyable approach, because it is related to the method of steepest decent.( It follows a force that pulls the end-effector towards its desired target location).

Advantages:
1. Simple computation (numerically robust)
2. No matrix inversions

Disadvantages:
1. Needs many iterations until convergence in certain configurations 
2. Unpredictable joint configurations
3. Non conservative

  下面以V-rep中官方自带的例子(在文件夹scenes/ik_fk_simple_examples中)为基础进行修改,添加代码手动实现运动学逆解的求解。为了实现同样的功能先将两个旋转关节从Inverse kinematics mode设为Passive mode,然后将target和tip的Linked dummy设为none,并在Calculation Modules的Inverse kinematics选项卡中取消IK groups enabled。下图中红色的dummy为target dummy,仿真开始后程序会计算连杆末端(tip dummy)与target之间的误差,然后根据Jacobian Transpose方法不断计算关节调整量,直到误差小于容许值。

  如下图所示,迭代计算61次收敛后,点击图中的Compute IK按钮,连杆末端能根据计算出的关节角q1,q2移动到target的位置(可以随意拖动target的位置,在合理的范围内经过逆解计算tip都会与target重合)

在child script中由lua API实现了该方法

if (sim_call_type==sim_childscriptcall_initialization) then
ui=simGetUIHandle('UI')
J1_handle = simGetObjectHandle('j1')
J2_handle = simGetObjectHandle('j2')
target_handle = simGetObjectHandle('target')
consoleHandle = simAuxiliaryConsoleOpen('info', , +, {,},{,}) --link length
L1 = 0.5
L2 = 0.5 gamma = --step size
stol = 1e-2 --tolerance
nm = --initial error
count = --iteration count
ilimit = --maximum iteratio --initial joint value
q1 =
q2 =
end if (sim_call_type==sim_childscriptcall_actuation) then
local a=simGetUIEventButton(ui)
local target_pos = simGetObjectPosition(target_handle, -) if(nm > stol)
then
simAuxiliaryConsolePrint(consoleHandle, nil) local x, y = L1*math.cos(q1)+L2*math.cos(q1+q2), L1*math.sin(q1)+L2*math.sin(q1+q2)
local delta_x, delta_y = target_pos[] - x, target_pos[] - y
local dq_1 = (-L1*math.sin(q1)-L2*math.sin(q1+q2))*delta_x + (L1*math.cos(q1)+L2*math.cos(q1+q2))*delta_y
local dq_2 = (-L2*math.sin(q1+q2))*delta_x + (L2*math.cos(q1+q2))*delta_y
q1, q2 = q1 + gamma*dq_1, q2 + gamma*dq_2 nm = math.sqrt(delta_x * delta_x + delta_y * delta_y) count = count +
if count > ilimit then
simAuxiliaryConsolePrint(consoleHandle,"Solution wouldn't converge\r\n")
end simAuxiliaryConsolePrint(consoleHandle, string.format("q1:%.2f", q1*/math.pi)..' '..string.format("q2:%.2f", q2*/math.pi)..'\r\n')
simAuxiliaryConsolePrint(consoleHandle, string.format("x:%.2f",x)..' '..string.format("y:%.2f", y)..'\r\n')
simAuxiliaryConsolePrint(consoleHandle, string.format("%d", count)..'iterations'..' '..string.format("err:%.4f", nm)..'\r\n')
end -- if the button(a is the button handle) is pressed
if a== then
simSetJointPosition(J1_handle, q1+math.pi/) -- the angle between L1 and X-axis is 90 degree
simSetJointPosition(J2_handle, q2)
end
end

V-rep学习笔记:机器人逆运动学数值解法(The Jacobian Transpose Method)的更多相关文章

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

  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学习笔记:机器人逆运动学解算

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

  5. matlab学习笔记10_6 字符串与数值间的转换以及进制之间的转换

    一起来学matlab-matlab学习笔记10 10_6 字符串与数值间的转换以及进制之间的转换 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考书籍 <matlab 程序设计与综合 ...

  6. ES6学习笔记(四)-数值扩展

    PS: 前段时间转入有道云笔记,体验非常友好,所以笔记一般记录于云笔记中,每隔一段时间,会整理一下, 发在博客上与大家一起分享,交流和学习. 以下:

  7. python学习笔记(五)数值类型和类型转换

    Python中的数值类型有: 整型,如2,520 浮点型,如3.14159,1.5e10 布尔类型 True和False e记法: e记法即对应数学中的科学记数法 >>> 1.5e1 ...

  8. ES6学习笔记(四)数值的扩展

    1.二进制和八进制表示法 ES6 提供了二进制和八进制数值的新的写法,分别用前缀0b(或0B)和0o(或0O)表示. 0b111110111 === 503 // true 0o767 === 503 ...

  9. Python学习笔记(2)数值类型

    进制转换 int函数任意进制转换为10进制 第一个参数传入一个字符串,任意进制的,第二个参数传入对这个字符串的解释,解释他为几进制 hex oct bin转换进制为16 8 或者2进制 例题中石油87 ...

随机推荐

  1. redis 笔记06 发布与订阅、事务、慢查询日志、监视器

    发布与订阅 1. 服务器状态在pubsub_channels字典保存了所有频道的订阅关系:SUBSCRIBE命令负责将客户端和被订阅的频道关联到这个字典里面,而UNSUBSCRIBE命令则负责 解除客 ...

  2. 161018、springMVC中普通类获取注解service方法

    1.新建一个类SpringBeanFactoryUtils 实现 ApplicationContextAware package com.loiot.baqi.utils; import org.sp ...

  3. scala偏函数

    package com.ming.test /** * 在Scala中,偏函数是具有类型PartialFunction[-T,+V]的一种函数.T是其接受的函数类型,V是其返回的结果类型. * 偏函数 ...

  4. 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.9.Progressbar控件

    Progressbar控件用来显示任意进程的完成百分比. 默认安装启用 配置选项 控件暴露的事件API progressbar暴露的独一无二的方法 一些现实生活的例子 当前版本中,我们或系统必须明确进 ...

  5. struts2的两个核心配置文件

    struts2的两个核心配置文件,即:struts.default.xml和struts.properties A,位置:都在struts2-core-version.jar文件中 B,作用,stru ...

  6. ectouch第八讲 之模板内容修改

    前台:1.前台页面logo代码[ 文件位置:\mobile\themes\default\index.dwt] <div style="text-align: center;paddi ...

  7. 【转载】PostgreSQL分区表(Table Partitioning)应用

    博客地址--点击

  8. word中设置前几页为罗马数字,后几页设置为阿拉伯数字

    假如第1-5页摘要部分页脚要是罗马数字,第6页开始是正文部分是阿拉伯数字,起始页为1. WORD2003 1.将光标定位在第5页末尾处,在菜单栏中依次点击“插入——分隔符——(分节符类型)下一页”.按 ...

  9. 在IE6下使用filter设置png背景

    今天帮别人解决问题学会了一个在IE6下使用filter设置png背景,具体css写法如下: .login_form_wrap { width: 778px; height: 360px; backgr ...

  10. Network 分类: POJ 图论 2015-07-27 17:18 17人阅读 评论(0) 收藏

    Network Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 14721 Accepted: 5777 Special Judg ...