| Cyclic Coordinate Descent in 2D - Local Minima |
|
|
| Wednesday, 11 February 2009 04:43 | ||||||||||||||
Page 4 of 5
Local MinimaUnfortunately, there are some kinks with CCD. From certain initial poses, the algorithm will fail to find the proper solution to a problem. I don't know of any CCD literature that discusses (or really even mentions) this subject, but I will show an example problem. Fortunately, this doesn't often come up in practice and depending on the requirements of your IK simulation and the mobility of your kinematic chain, you may be able to ignore it.
Given a two bone chain where both bones start with no rotation, we can place the target in a position that will lock up CCD at an invalid result. Our initial setup can be seen in figure 3a.
If CCD was able to give us a valid solution, bone1 would bend away from the target allowing bone2 to bend towards the target. One possible valid solution is shown in figure 3b.
When actually performing the CCD algorithm, we will get stuck at a local minimum (see figure 3c). The first step of CCD will rotate bone2 to point towards the target. This will result in a rotation of 180 degrees and will get the end effector as close to the target as possible with regards to the mobility of bone2. It is now bone1's turn to place the end effector as close to the target as possible. It turns out that bone1 is already in the optimal position and therefore does nothing. We are now in a situation where both bones are in optimal positions and they will no longer move as we continue to iterate the algorithm.
It should be noted that if the joints had rotational constraints (could not spin 180 degrees), we would have avoided this singularity, but adding rotational constraints can lead to a whole new set of local minima.
CCD considers one joint at a time with no real care about how the rest of the joints behave. The only part of the algorithm that even recognizes the joint hierarchy is the requirement that we loop backwards from the end joint to the root joint. It should also be noted that the individual steps of the algorithm aren't aware that they are part of a larger iteration towards a solution. This results in a fairly myopic view of the larger IK problem when optimizing a single joint.
We are computing the joint orientation that will instantly get the end effector to the optimal position for the current joint. If we were a bit less selfish, we could consider the limitations of the other joints when defining what our optimal orientation actually is. This steps a bit away from the pure CCD algorithm which tries to minimize the error from the target position one joint at a time. Is there some new equation we would be minimizing by taking the rest of the hierarchy into account? In the past, I've tried adding some conditions to detect undesired solutions, but am yet to build something robust enough to handle all problem cases while maintaining efficiency.
|
||||||||||||||
| Last Updated ( Sunday, 02 May 2010 06:28 ) | ||||||||||||||





