逆向运动学CCD算法的工作 [英] Working of CCD algorithm for Inverse Kinematics

查看:25
本文介绍了逆向运动学CCD算法的工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个机械臂,在 3D 空间中的 A、B、C、D 点有关节.设 D 为末端执行器(最底层的孩子),A 为最顶层的父项.设 T 为空间中任意位置的目标点.目的是使末端执行器在顶层(父级)中以最小的旋转到达目标.

Lets say I've a robotic arm with joints at points A,B,C,D in a 3D space. Let D be the end effector(bottommost child) and A be the topmost parent. Let T be the target point anywhere in the space. The aim is to make the end effector reach the target with minimum rotations in top levels(parents).

我最初的想法:

1) 将手臂 C 旋转角度 TCD.2) 然后将臂 B 旋转新的角度 TBD.3) 然后将手臂 A 旋转新的角度 TAD.

1) Rotate the arm C by angle TCD. 2) Then rotate the arm B by new angle TBD. 3) Then rotate the arm A by new angle TAD.

但是在第 2 步之后,末端执行器似乎指向远离目标的方向.我做错了什么,我该如何解决?

But the end effector seems to point away from the target after step 2. What am I doing wrong and how can I fix it?

推荐答案

在我开始使用一些更高级的方法之前,我是这样做的:

Before I started use some more advanced approaches I did it like this:

pe=desired_new_position;

for (i=0;i<number_of_actuators;i++)
 {
 // choose better direction
                   p=direct_kinematics(); d =|p-pe|; // actual step
 actuator(i)--;  p=direct_kinematics(); d0=|p-pe|; // previous step
 actuator(i)+=2; p=direct_kinematics(); d1=|p-pe|; // next step
 actuator(i)--;  dir=0; d0=d;
      if ((d0<d)&&(d0<d1)) dir=-1;
 else if ((d1<d)&&(d1<d0)) dir=+1;
 else continue;

 for (;;)
  {
  actuator(i)+=dir; p=direct_kinematics(); d =|p-pe|;
  if (d>d0) { actuator(i)-=dir; break; }
  if (actuator(i) on the edge limit) break;
  }

 }

[注释]

  1. 您可以通过一些步骤而不是 1 将其修改为 inc/dec 执行器位置

  1. you can modify it to inc/dec actuator position by some step instead of 1

如果差异过零则停止然后以较小的步长重新开始直到 step == 1 这将提高性能但对于大多数应用程序来说 step=1 就足够了,因为新位置是通常接近最后一个.

stop if difference crossed zero then start again with smaller step until step == 1 This will improve performance but for most application is step=1 enough because new position is usually near the last one.

注意这可能会卡在局部最小值/最大值

beware that this can get stuck in local min/max

如果输出卡住(效应器位置不变),则随机化执行器并重试.这种情况的发生取决于运动学复杂性和您要使用的路径类型

if the output get stuck (effector position is unchanged) then randomize the actuators and try again. Occurrence of this depend on the kinematics complexity and on the kind of path you want to use

如果手臂更多地在顶部而不是在底部

if the arms are driven more on the top then on the bottom

然后尝试反转 i-for 循环

then try reverse the i-for loop

如果你要控制效应器正常

if you have to control the effector normal

那么你必须从CCD中排除它的旋转轴并在CCD之前设置它

then you have to exclude its rotation axises from CCD and set it before CCD

这篇关于逆向运动学CCD算法的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆