44 Frame T_local, T_joint;
48 int i=chain.getNrOfSegments()-1;
49 unsigned int q_nr = chain.getNrOfJoints();
53 const Segment& segment = chain.getSegment(
i);
54 int ndof = segment.getJoint().getNDof();
58 T_joint = segment.getJoint().pose(((
JntArray&)q_in)(q_nr));
60 T_local = T_joint*segment.getFrameToTip();
62 T_total = T_local * T_total;
64 for (
int dof=0; dof<ndof; dof++) {
66 T_joint.
p = T_local.
p;
68 t_local = segment.twist(T_joint, 1.0, dof);
70 t_local = t_local.RefPoint(T_total.p - T_local.
p);
72 t_local = T_total.M.Inverse(t_local);
74 jac.
twists[q_nr+dof] = t_local;