本文整理匯總了C++中Collection::SpinMotor方法的典型用法代碼示例。如果您正苦於以下問題:C++ Collection::SpinMotor方法的具體用法?C++ Collection::SpinMotor怎麽用?C++ Collection::SpinMotor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Collection
的用法示例。
在下文中一共展示了Collection::SpinMotor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: if
//.........這裏部分代碼省略.........
}
break;
case 3:
#ifndef DISABLE_SHOOTER
switch(auto_state) {
case 0:
// Home/rearm
// fire, rearm, eject
myCam->Process(false, false, false);
if (myCam->IsReadyToFire()) {
auto_state = 1;
}
break;
case 1:
// fire
myCam->Process(true, false, false);
if (myCam->IsReadyToRearm()) {
auto_state = 2;
}
break;
case 2:
// rearm
myCam->Process(false, true, false);
if (myCam->IsReadyToFire()) {
auto_state = 3;
auto_timer->Reset();
auto_timer->Start();
}
break;
case 3:
myCam->Process(false, false, false);
myCollection->SpinMotor(Config::GetSetting("intake_roller_speed", .7));
if (auto_timer->HasPeriodPassed( Config::GetSetting("auto_collection_delay", 1.0) )) {
auto_state = 4;
}
break;
case 4:
// fire again!
myCam->Process(true, false, false);
auto_state = 5;
break;
case 5:
myCam->Process(false, false, false);
if(myDrive->GetOdometer() <= 216 - Config::GetSetting("auto_firing_distance", 96)) //216 is distance from robot to goal
{
myDrive->Drive(corrected, speed);
} else {
// now at the firing spot.
auto_state = 6;
myDrive->Drive(0,0);
}
break;
case 6:
myCollection->RetractArm();
break;
default:
cout << "Error, unrecognized state " << auto_state << endl;
}
#endif //Ends DISABLE_SHOOTER
break;
case 4: /* One ball Autonomous - Drive forward specific distance, stop then shoot.*/