Hi Robert,

thanks a lot for your reply and sorry for my late answer. You were completely 
right regarding the seg faults: I was not careful enough but now the problem 
seems to be solved. Nevertheless, I was more wondering what the best way to 
switch from a forward to an inverse kinematic chain (KC) is. I have attached to 
this message a very simple code to illustrate what I would like to achieve. I 
used the osgrobot.cpp example and created a set of 4 boxes (corresponding to 
the joints) linked together in a direct chain using PositionAttitudeTransform 
to manage their position and orientation. They are rotating around the x axis 
(represented by a grey cylinder). They can be controlled using the original 
keyboard handler provided in the example. I would like to be able to use two 
keyboard keys (in the code "t" and "g") to switch from a direct chain to an 
inverse KC (with "t" and "g" respectively) while keeping constant the position 
and orientation of all the joints (if they have moved from t
 heir initial position): in one case (direct KC), the black box would be the 
first parent of the chain, and in the other (inverse KC), it would be the red 
box (the transformations that happened during those two cases have to be kept, 
i.e. I do not want to restart from the initial position and orientation).   

In addition to the tried solutions I mentioned in my previous message, I've 
also checked the panda3D framework (http://www.panda3d.org/) and it seems that 
there is a function for re-parenting that keep the position and orientation 
constant (wrtReparentTo, The "wrt" prefix stands for "with respect to". This 
special method works like reparentto(), except that it automatically recomputes 
the local transform on myModel to compensate for the change in transform under 
the new parent, so that the node ends up in the same position relative to the 
world.) : I was wondering if an equivalent to this function exists in osg? 

It would be really helpful to me if somebody would have an example of a working 
implementation of this KC switching (corresponding in the attached example code 
to the function "forwardKinematicChain()" and "inverseKinematicChain()", line 
121 and 138, respectively). 

I'm really thankful for the help that you already provided and I hope I will be 
able to find a good solution for this issue.

Best,

Stéphane

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52000#52000




Attachments: 
http://forum.openscenegraph.org//files/main_166.cpp


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to