本文整理汇总了C++中Hand::close方法的典型用法代码示例。如果您正苦于以下问题:C++ Hand::close方法的具体用法?C++ Hand::close怎么用?C++ Hand::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hand
的用法示例。
在下文中一共展示了Hand::close方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wam_main
int wam_main(int argc, char** argv, ProductManager& pm, systems::Wam<DOF>& wam) {
BARRETT_UNITS_TEMPLATE_TYPEDEFS(DOF);
// These vectors are fixed sized, stack allocated, and zero-initialized.
jp_type jp; // jp is a DOFx1 column vector of joint positions
cp_type cp; // cp is a 3x1 vector representing a Cartesian position
wam.gravityCompensate();
printMenu();
Hand* hand = pm.getHand();
std::string line;
bool going = true;
while (going) {
printf(">>> ");
std::getline(std::cin, line);
switch (line[0]) {
case 'p':
moveToStr(wam, &cp, "tool position", line.substr(1));
break;
case 'j':
moveToStr(wam, &jp, "joint positions", line.substr(1));
break;
case 'h':
std::cout << "Moving to home position: "
<< wam.getHomePosition() << std::endl;
wam.moveHome();
break;
case 'i':
printf("WAM idled.\n");
wam.idle();
break;
case 'g':
hand->trapezoidalMove(Hand::jp_type(M_PI/3.0), Hand::SPREAD);
break;
case 'o':
hand->initialize();
// hand->close(Hand::GRASP);
// hand->open(Hand::GRASP);
// hand->close(Hand::SPREAD);
// hand->trapezoidalMove(Hand::jp_type(M_PI/2.0),1, Hand::GRASP);
// hand->trapezoidalMove(Hand::jp_type(M_PI/2.0), Hand::GRASP);
break;
case 'a':
// hand->initialize();
hand->close(Hand::SPREAD);
// hand->close(Hand::GRASP);
break;
case 'c':
// hand->initialize();
hand->close(Hand::GRASP);
break;
// case 'f':
// while (std::getline(file_jp,line_jp))
// {
// moveToStr(wam, &jp, "joint positions", line_jp);
// waitForEnter();
// }
// break;
case 'd':
// hand->initialize();
hand->open(Hand::SPREAD);
break;
case 'e':
// hand->initialize();
hand->open(Hand::GRASP);
break;
case 'b':
hand->trapezoidalMove(Hand::jp_type(M_PI/2.0), Hand::GRASP);
break;
case 't':
hand->trapezoidalMove(Hand::jp_type((M_PI)/6.0), Hand::GRASP);
// std::cout << "sending back a message..." << std::endl;
break;
case 'm':
// temp_str = line.substr(2);
iss2.clear();
iss2.str("");
iss2.str(line.substr(2)) ;
iss2 >> angle_degree;
// std::cin >> angle_degree;
angle_radian = angle_degree*(M_PI/180);
hand->trapezoidalMove(Hand::jp_type(angle_radian), Hand::GRASP);
//.........这里部分代码省略.........
示例2: closeGrasp
bool BHandNode::closeGrasp(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res)
{
ROS_INFO("Closing the BarrettHand Grasp");
hand->close(Hand::GRASP, false);
return true;
}
示例3: closeSpread
bool BHandNode::closeSpread(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res)
{
ROS_INFO("Closing the BarrettHand Spread");
hand->close(Hand::SPREAD, false);
return true;
}