本文整理汇总了C++中Jacobian::changeBase方法的典型用法代码示例。如果您正苦于以下问题:C++ Jacobian::changeBase方法的具体用法?C++ Jacobian::changeBase怎么用?C++ Jacobian::changeBase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jacobian
的用法示例。
在下文中一共展示了Jacobian::changeBase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFloatingBaseJacobianLoop
void getFloatingBaseJacobianLoop(const UndirectedTree & undirected_tree,
const GeneralizedJntPositions &q,
const Traversal & traversal,
const int link_index,
Jacobian & jac)
{
Frame T_total = Frame::Identity(); //The transformation between link_index frame and current_link frame
assert(link_index < (int)undirected_tree.getNrOfLinks());
KDL::CoDyCo::LinkMap::const_iterator current_link;
current_link = undirected_tree.getLink(link_index);
//All the columns not modified are zero
SetToZero(jac);
KDL::CoDyCo::LinkMap::const_iterator parent_link=traversal.getParentLink(current_link);
while(current_link != traversal.getBaseLink()) {
double joint_pos = 0.0;
if( current_link->getAdjacentJoint(parent_link)->getNrOfDOFs() == 1 ) {
KDL::Twist jac_col;
int dof_index = current_link->getAdjacentJoint(parent_link)->getDOFIndex();
joint_pos = q.jnt_pos(dof_index);
KDL::Twist S_current_parent = parent_link->S(current_link,joint_pos);
jac_col = T_total*S_current_parent;
assert(6+dof_index < (int)jac.columns());
assert( dof_index < (int)undirected_tree.getNrOfDOFs() );
jac.setColumn(6+dof_index,jac_col);
}
KDL::Frame X_current_parent = parent_link->pose(current_link,joint_pos);
T_total = T_total*X_current_parent;
current_link = parent_link;
parent_link = traversal.getParentLink(current_link);
}
//Setting the floating part of the Jacobian
T_total = T_total*KDL::Frame(q.base_pos.M.Inverse());
jac.data.block(0,0,6,6) = TwistTransformationMatrix(T_total);
jac.changeBase(T_total.M.Inverse());
}
示例2: changeRepresentation
void changeRepresentation(Jacobian& J,const Frame& F_bs_ee,const int& representation)
{
switch(representation)
{
case ChainJntToJacDotSolver::HYBRID:
break;
case ChainJntToJacDotSolver::BODYFIXED:
// Ref Frame {ee}, Ref Point {ee}
J.changeBase(F_bs_ee.M.Inverse());
break;
case ChainJntToJacDotSolver::INTERTIAL:
// Ref Frame {bs}, Ref Point {bs}
J.changeRefPoint(-F_bs_ee.p);
break;
}
}