本文整理汇总了C++中Hand::getInnerLinkPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Hand::getInnerLinkPosition方法的具体用法?C++ Hand::getInnerLinkPosition怎么用?C++ Hand::getInnerLinkPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hand
的用法示例。
在下文中一共展示了Hand::getInnerLinkPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assertPosition
void assertPosition(Hand& hand, Hand::jp_type innerLinkJp, double tolerance = 0.05) {
hand.update();
if (math::abs(hand.getInnerLinkPosition() - innerLinkJp).maxCoeff() > tolerance) {
std::cout << hand.getInnerLinkPosition() << " is not close enough to " << innerLinkJp << "\n"<<"moving to home"<<std::endl;
exit(2);
}
}
示例2: publish
void BHandNode::publish(void)
{
hand->update(); // Update the hand sensors
Hand::jp_type hi = hand->getInnerLinkPosition(); // get finger positions information
Hand::jp_type ho = hand->getOuterLinkPosition();
for (size_t i = 0; i < 4; i++) // Save finger positions
bhand_joint_state.position[i] = hi[i];
for (size_t j = 0; j < 3; j++)
bhand_joint_state.position[j + 4] = ho[j];
bhand_joint_state.header.stamp = ros::Time::now(); // Set the timestamp
bhand_joint_state_pub.publish(bhand_joint_state); // Publish the BarrettHand joint states
btsleep(1.0 / PUBLISH_FREQ); // Sleep according to the specified publishing frequency
}