IK by relaxation or solving with newton and Danavit-Hartenberg

I am faced with an exercise text which is formulated as the folowing
"Implement an Inverse Kinematics Solver. Show that you can compute
joint positions according to a given wanted position and orientation of an end-effector"
There are two ways of doing this. There are probably more, but currently I can think of two. One is to describe the links and joints as translations and rotations (Danavit-hartenberg) and solve a system of equations by minimization to go from pose0 to pose1, where pose0 is given and the position and orientation of the end effector is given for pose1. I can define an equation of the unknowns and thereby find what rotations (and possible translations) the joints need to have to put the end effector where is is wanted.
The other solution is to start at pose0 and then just move and rotate the end effector into the position and orientation that i want, and fix it there. Then I can do relaxiation of the whole system and it should fall into place. The links will have length constraints on them and the joints possible consttraints on the rotations. When first moving the end effector, the constraints will probably be broken, but the relaxation should give me a valid solution (if it exists) and everything is fine.
The thing is... for me the relaxation seems very very much simpler to implement. I am however worried that it somehow has its weaknesses since my textbook doesn't mention it but only the other solution. I have done something like this before when fiddint a skeleton to motioncaptured 3d points, and it works fine, as far as I can see, but... is it a valid solution for Ik and is it a valid solution to the given assignment, based on the text?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Jakob Nielsen wrote:

It's just homework.
There are analytical solutions for systems which have a unique set of joint positions for each end effector position. That's what was used on industrial robots with very limited CPU power, and many industrial robots are still doing it that way. If your robot has such a geometry, that's the way to go.
If you have redundant degrees of freedom, so that there are an infinite number of possible solutions, some additional problems appear. But CPU power for relaxation or minimization usually isn't one of them any more.
One problem with minimization methods is that, for some geometries, you can get caught in a local minimum. Think of reaching around to scratch your back, but from the wrong side.
Another problem is that, in practice, you want a sequence of solutions, and you want them to be close together. A small move of the desired end effector position should result in small changes in desired joint angles. Solutions which don't have that property are undesirable for robot control, since they'll cause unwanted large joint moves.
                    John Nagle
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Currently this is more of a theoretical question, since my solution just has to show IK in action, but I would like to be able to easily extend it to a very complex shape. The analytical solution will therefore not be an option. The solution should easily adapt to different joint configurations, and they should be alowed to be rather complex.

I am faced with selecting between minimization and relaxation, which in a sence boils down to the same.

I am wondering. Can this never happens for relaxation? intuitively I would expect it to be just as volnourable to that as minimization. After all, relaxation is generally a linear minimization. If you imagine two joints with a link length constraint, oriented so that they form a 45 degree sloped line, and in between the two you have an irregularly shaped object. The constraint is initially violated because the joint length is stretched out, so the joints need to move together. As they do they collide with the object and get locked into an indentation, and relaxation wont get it loose.. unless you add some random wiggeling.

That makes sence. Will minimization and relaxation not both give the smallest movement, if the starting point of the methods are both the initial position?
Can you confirm my understanding that the initial text does not in any way implie that relaxation can not be used? Another thing... the relaxation I have done is not related to robotics, so perhaps things are done diferently. The very basic idea is to have joints connected with distance constraints. You start with an initial pose, you move the parts thet you want moved and fix them. Then the constraints are broken and you relax the system, which will pull the non-fixed parts in closer so the constraints are not violated. The reason I keep digging in that specific subject is that looking for robots and relaxation never returns anything but into on route planning and other non relatex subjects.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Jakob Nielsen wrote:

If your kinematic chain has some extra DOF you must select one of family of solutions as sole output (result). In case if such selection is hidden (implicit) part of compared approaches, you must expect different output from different methods. If criterion of selection of single result from set of possible is explicitly formulated and criterion is the same in both cases you will get the same result.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I am not sure that I understand you. Are you saying that if there is only one solution (which is rarely the case) thebn both methods will give the same result, whereas a multisolution system will give different solutions, so I need to decide which kind of solutions that i want? Will relaxation and minimization (by newton with the jacobian) with the same starting and ending pose, not always give the same result?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Jakob Nielsen wrote:

Yes. But maybe in your case any solution is appropriate?

Moreover, if minimization algorithm has some parameters then processes with different values of such parameters will produce different solutions in case multisolution.
In case if multisolution is presented A PRIORI then you can select particular unique solution by adding extra term to minimized function which expected to be minimal for most desired solution (for example sum of squares of joint position increments or energy consumed for motion from previous state). Multiplier for such additional criterion is an additional parameter of algorithm and must be assigned after experimenting; when this factor has appropriate value then result of minimization is insensitive for value of multiplier in relatively wide range.
In multisolution case Jacobian has one or more zero eigen values so adding correspondent eigen vector to particular solution with any multiplier produce another (close) solution; additional criterion used to select most appropriate solution from such family.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.