本文整理汇总了C++中IPositionControl::setPositionMode方法的典型用法代码示例。如果您正苦于以下问题:C++ IPositionControl::setPositionMode方法的具体用法?C++ IPositionControl::setPositionMode怎么用?C++ IPositionControl::setPositionMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPositionControl
的用法示例。
在下文中一共展示了IPositionControl::setPositionMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]) {
time_t timev;
printf("WARNING: requires a running instance of RaveBot (i.e. testRaveBot or cartesianServer)\n");
Network yarp;
if (!Network::checkNetwork()) {
printf("Please start a yarp name server first\n");
return(-1);
}
Property options;
options.put("device","remote_controlboard");
options.put("remote","/teo/leftArm");
options.put("local","/local");
PolyDriver dd(options);
if(!dd.isValid()) {
printf("RaveBot device not available.\n");
dd.close();
Network::fini();
return 1;
}
IPositionControl *pos;
bool ok = dd.view(pos);
if (!ok) {
printf("[warning] Problems acquiring robot interface\n");
return false;
} else printf("[success] testAsibot acquired robot interface\n");
pos->setPositionMode();
for(b=0; b<20; b++){
a=0;
if (a==0) {
printf("MOVE TO POSITION 01\n");
pos->positionMove(0, -30);
pos->positionMove(1, 40);
pos->positionMove(2, 0);
pos->positionMove(3, -70);
pos->positionMove(4, -40);
pos->positionMove(5, 10);
pos->positionMove(6, 0);
Time::delay(5);
a=1;
}
if (a==1) {
printf("MOVE TO POSITION 02\n");
pos->positionMove(0, -10);
pos->positionMove(1, 30);
pos->positionMove(2, 0);
pos->positionMove(3, -90);
pos->positionMove(4, -30);
pos->positionMove(5, 10);
pos->positionMove(6, 0);
Time::delay(5);
a=2;
}
if (a==2) {
printf("MOVE TO POSITION 03\n");
pos->positionMove(0, -30);
pos->positionMove(1, -10);
pos->positionMove(2, 0);
pos->positionMove(3, -70);
pos->positionMove(4, 10);
pos->positionMove(5, 10);
pos->positionMove(6, 0);
Time::delay(5);
a=0;
}
}
/* b=5;
a=0;
if(a==0&&b>=0){
printf("test positionMove(1,-35)\n");
pos->positionMove(1, b);
b--;
} */
printf("Delaying 5 seconds...\n");
Time::delay(5);
/* IEncoders *enc;
ok = dd.view(enc);
IVelocityControl *vel;
ok = dd.view(vel);
vel->setVelocityMode();
printf("test velocityMove(0,10)\n");
vel->velocityMove(0,10);
printf("Delaying 5 seconds...\n");
Time::delay(5); */
return 0;
//.........这里部分代码省略.........