29 static fMat Jtemp_other;
34 for(i=0; i<n_dof; i++)
36 double*
a = Jtemp.
data() + 6*
i;
37 double*
b = Jtemp_other.
data() + 6*
i;
39 double m1 = *(a+1) - *(b+1);
40 double m2 = *(a+2) - *(b+2);
41 double m3 = *(a+3) - *(b+3);
42 double m4 = *(a+4) - *(b+4);
43 double m5 = *(a+5) - *(b+5);
58 double*
a =
J.
data() + count;
59 int b_row = Jtemp.
row();
60 double*
b = Jtemp.
data() +
i;
61 for(j=0; j<n_dof; a+=a_row, b+=b_row, j++)
77 static fVec3 fb_pos, fb_att;
93 cur_att.
mul(rt, catt);
104 fb(count) = fb_pos(i);
112 fb(count) = fb_att(i);
void rotation(const fMat33 &ref, const fMat33 &tgt)
Computes the rotation from tgt to ref.
int resize(int i, int j)
Changes the matrix size.
int CalcJacobian(fMat &J)
The Jacobian matrix of position/orientation w.r.t. the joint values.
fMat33 abs_att
current constraint orientation
int calc_feedback()
compute the feedback velocity
void set(const fMat33 &mat)
Copies a matrix.
void mul(const fMat33 &mat1, const fMat33 &mat2)
friend fMat33 tran(const fMat33 &m)
Returns the transpose.
int row() const
Returns the number of rows.
Inverse kinematics (UTPoser) class.
void zero()
Creates a zero matrix.
Joint * joint
target joint
def j(str, encoding="cp932")
int NumDOF()
Total degrees of freedom.
fVec fb
Jacobian matrix (n_const x total DOF)
fMat33 abs_att
absolute orientation
fVec3 abs_pos
current constraint position
double * data() const
Returns the pointer to the first element.
int calc_jacobian()
Computes the constraint Jacobian.
void sub(const fVec3 &vec1, const fVec3 &vec2)
fVec3 abs_pos
absolute position
void mul(const fVec3 &vec, double d)
IK::ConstIndex const_index[6]
with/without constraint for each DOF
Matrix of generic size. The elements are stored in a one-dimensional array in row-major order...
Joint * other_joint
connected to other joint: constrains the relative position and/or orientation w.r.t. other_joint's frame