V-rep学习笔记:机器人逆运动学数值解法(The Jacobian Transpose Method)
机器人运动学逆解的问题经常出现在动画仿真和工业机器人的轨迹规划中: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) thenui=simGetUIHandle('UI')J1_handle = simGetObjectHandle('j1')J2_handle = simGetObjectHandle('j2')target_handle = simGetObjectHandle('target')consoleHandle = simAuxiliaryConsoleOpen('info', 5, 2+4, {100,100},{800,300})--link lengthL1 = 0.5L2 = 0.5gamma = 1 --step sizestol = 1e-2 --tolerancenm = 100 --initial errorcount = 0 --iteration countilimit = 1000 --maximum iteratio--initial joint valueq1 = 0 q2 = 0 endif (sim_call_type==sim_childscriptcall_actuation) thenlocal a=simGetUIEventButton(ui)local target_pos = simGetObjectPosition(target_handle, -1)if(nm > stol) thensimAuxiliaryConsolePrint(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[1] - x, target_pos[2] - ylocal dq_1 = (-L1*math.sin(q1)-L2*math.sin(q1+q2))*delta_x + (L1*math.cos(q1)+L2*math.cos(q1+q2))*delta_ylocal dq_2 = (-L2*math.sin(q1+q2))*delta_x + (L2*math.cos(q1+q2))*delta_yq1, q2 = q1 + gamma*dq_1, q2 + gamma*dq_2nm = math.sqrt(delta_x * delta_x + delta_y * delta_y)count = count + 1if count > ilimit thensimAuxiliaryConsolePrint(consoleHandle,"Solution wouldn't converge\r\n")endsimAuxiliaryConsolePrint(consoleHandle, string.format("q1:%.2f", q1*180/math.pi)..' '..string.format("q2:%.2f", q2*180/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 pressedif a==1 thensimSetJointPosition(J1_handle, q1+math.pi/2) -- the angle between L1 and X-axis is 90 degreesimSetJointPosition(J2_handle, q2) end end
V-rep学习笔记:机器人逆运动学数值解法(The Jacobian Transpose Method)相关推荐
- python计算机器人运动学分析_V-rep学习笔记:机器人逆运动学数值解法(The Jacobian Transpose Method)...
机器人运动学逆解的问题经常出现在动画仿真和工业机器人的轨迹规划中:We want to know how the upper joints of the hierarchy would rotate ...
- 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算法 ...
- python计算机器人运动学分析_机器人学之逆运动学数值解法及SVD算法
机器人学之逆运动学数值解法及SVD算法 文章目录 前言 这半个月的业余时间研究了机器人逆运动学的解析解法和迭代数值解法,并用程序实现.由于解析法只适合于特定结构的机器人,不具有通用性,因此这里不讨论解 ...
- 通用求根算法zeroin_Modern Robotics运动学数值解法及SVD算法(C matlab)
前言 原著之前CSDN已经注销,新CSDN Galaxy_Robot的博客_CSDN博客-机器人,C语言,我是谁?领域博主blog.csdn.net 这半个月的业余时间研究了机器人逆运动学的解析解法 ...
- MATLAB仿真Gough-Stewart并联机器人斯图尔特6自由度并联机器人逆运动学仿真 动力学控制pid控制
MATLAB仿真Gough-Stewart并联机器人斯图尔特6自由度并联机器人逆运动学仿真 动力学控制pid控制 1.搭建了六自由度Stewart并联机器人simulink simscape仿真模型 ...
- V-rep学习笔记:机器人逆运动学解算
IK groups and IK elements VREP中使用IK groups和IK elements来进行正/逆运动学计算,一个IK group可以包含一个或者多个IK elements: I ...
- 基于几何法的机器人逆运动学求解--工业机器人前三个关节
利用几何法求解工业机器人逆运动学是将空间中的机器人结转换为几个正交平面下的几何法求解方法,就有简单,直观的效果.但是,对于机器人的一个空间位置姿态可能对于多种关节角的情况,采用几何法的求解可能会造成, ...
- ES6学习笔记(四)-数值扩展
PS: 前段时间转入有道云笔记,体验非常友好,所以笔记一般记录于云笔记中,每隔一段时间,会整理一下, 发在博客上与大家一起分享,交流和学习. 以下: 转载于:https://www.cnblogs.c ...
- matlab做机器人运动轨迹,matlab机器人工具箱学习笔记——机器人的运动轨迹
运动轨迹问题 机械臂在三维空间中的每个关节的位置.速度和加速度都是关于时间的函数,他们构成了机械臂的运动轨迹,这里主要有3个问题: 1)根据具体的操作任务给机械臂指定一条空间中的轨迹 2)描述一条规划 ...
最新文章
- Android中windowTranslucentStatus与windowTranslucentNavigation的一些设置(转)
- python生成器单线程_【Python】迭代器、生成器、yield单线程异步并发实现详解
- .NET语言的编译过程:中间语言(IL)和即时编译器(JIT)
- ./ 表示当前路径 ../ 表示上一级目录路径
- Ubuntu 16设置固定IP和DNS
- Delphi中的进制转换
- mediasoup-client 和 libmediasoupclient 指南
- C#创建无数据源水晶报表极简教程
- 现代化编程 -- 在 Swoole 上开发 Laravel 框架的应用
- viper4android ddc,蝰蛇音效v4a音效最新版
- Acid-PEG2000-Pyrene,羧基和芘丁酸修饰的PEG,HOOC-PEG2000-Pyrene
- element-ui 删除input框尾部默认图标和获取焦点边框高亮问题
- 爱荷华州立 计算机博士,美国爱荷华州立大学无损检测中心裴宁博士来我院讲学...
- PV 和 UV 的区别
- 移动开发之三种近场通信
- 《Java小游戏实现》:坦克大战
- photoshop 2021 for mac安装教程,亲测可用!!!
- Win2000请求拨号路由服务详解
- SSM实现邮箱验证功能
- 什么是Java的反射机制?