24 const std::string& segmentname) {
26 if (q_in.
rows() != tree.getNrOfJoints() || jac.
columns()
27 != tree.getNrOfJoints())
31 SegmentMap::value_type
const* it = tree.getSegmentPtr(segmentname);
40 SegmentMap::value_type
const* root = tree.getSegmentPtr(
"root");
43 Frame T_local, T_joint;
48 unsigned int q_nr = it->second.q_nr;
51 T_joint = it->second.segment.getJoint().pose(((
JntArray&)q_in)(q_nr));
53 T_local = T_joint*it->second.segment.getFrameToTip();
55 T_total = T_local * T_total;
58 int ndof = it->second.segment.getJoint().getNDof();
59 for (
int dof=0; dof<ndof; dof++) {
61 T_joint.
p = T_local.
p;
63 t_local = it->second.segment.twist(T_joint, 1.0, dof);
65 t_local = t_local.
RefPoint(T_total.p - T_local.
p);
67 t_local = T_total.M.Inverse(t_local);
69 jac.
twists[q_nr+dof] = t_local;
72 it = it->second.parent;