Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
661 views
in Technique[技术] by (71.8m points)

3d - Working of CCD algorithm for Inverse Kinematics

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

What I initially thought:

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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;
  }

 }

[notes]

  1. you can modify it to inc/dec actuator position by some step instead of 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.

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

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

    then try reverse the i-for loop

  4. if you have to control the effector normal

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...