Closed zhidao closed 1 year ago
Does it mean that each rkIK functions will have the in-out argument of a rkChain pointer whenever called?
I think it is nice for user to be able to give any rkChain pointer in anytime to rkIK functions.
It is good the idea to make comprehensive access point for users! In practice, when I used rkChain and rkIK, I defined my class named rkRobot, and wrap some methods for this class. If we choose above course, I think rkABI should be poped out from rkChain. i.e)
typedef _rkRobot{ // some master class name
rkIK ik;
rkChain chain;
rkABI abi;
// ... the other component if I have
} rkRobot;
My idea is to redefine rkChain as
typedef struct{
...
rkIK *_ik;
} rkChain;
and the API for the IK solver as
rkChainIK( chain, q, tol, iter );
instead of
rkIKSolve( ik, q, tol, iter );
by which I expect programmers may forget about rkIK.
BTW what is rkABI? @categoryik
I was wrong. I mean rkABIPrp. When I wrote above, I thought rkABIPrp is directly in rkChain.
The specification of inverse kinematics has been modified. A standard process of the inverse kinematics is as follows:
rkChainCreateIK( &chain );
rkChainRegIKJointAll( &chain, 1, 0.001 );
rkChainRegIKCell( &chain, ... );
...
rkChainDeactivateIK( &chain );
rkChainBindIK( &chain );
rkIKCellSetRef( &cell, ... );
rkChainIK( &chain );
No longer need to access an instance of rkIK directly. The internal instance of rkIK is automatically destroyed in rkChainDestroy().
Note that RoKi-GL was also modified because rk_pen uses the inverse kinematics solver. Update them together.
As you know, in the current implementation, rkIK is an outerclass of rkChain, and a target instance of rkChain has to be attached to rkIK by rkIKCreate.
Now, I'm thinking of including rkIK as a member of rkChain so that programmers can solve the IK much more easily, for example, by calling rkChainIK() without any care about how it is internally solved. It is also nicer for dealing with parallel kinematic chains, where structural constrains should be automatically embedded in models.
It needs a big modification. Any opinions? @n-wakisaka @categoryik @kdaic @takanobuyamamoto