本文整理汇总了C++中Tree::GetNumJoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Tree::GetNumJoint方法的具体用法?C++ Tree::GetNumJoint怎么用?C++ Tree::GetNumJoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree::GetNumJoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputeJacobian
void Jacobian::ComputeJacobian(const Tree& tree)
{
Invalidate();
jacobian_ = MatrixX(3,tree.GetNumJoint()-1); // à cause de son incrémentation débile
// Traverse this to find all end effectors
Vector3 temp;
Joint* n = tree.GetRoot();
while (n) {
if (n->IsEffector())
{
int i = n->GetEffectorNum();
// Find all ancestors (they will usually all be joints)
// Set the corresponding entries in the Jacobian J
Joint* m = tree.GetParent(n);
while (m) {
int j = m->GetJointNum();
assert (0 <=i && i<tree.GetNumEffector() && 0<=j && j<tree.GetNumJoint());
temp = m->GetS(); // joint pos.
temp -= n->GetS(); // -(end effector pos. - joint pos.)
Vector3 tmp2 = temp.cross(m->GetW()); // cross product with joint rotation axis
jacobian_.col(j-1) = tmp2;
m = tree.GetParent(m);
}
}
n = (n->IsEffector() ? 0 : tree.GetSuccessor(n));
}
}
示例2: LoadIntoTree
void Sample::LoadIntoTree(Tree& tree) const
{
Joint * j = tree.GetRoot();
assert(angles_.size() == tree.GetNumJoint());
{
for(Sample::LAngles::const_iterator it = angles_.begin(); it < angles_.end() && (j != 0); ++it)
{
j->SetTheta(*it);
j = j->pChild_;
}
tree.Compute();
}
}