本文整理汇总了C++中Drive::GetInputs方法的典型用法代码示例。如果您正苦于以下问题:C++ Drive::GetInputs方法的具体用法?C++ Drive::GetInputs怎么用?C++ Drive::GetInputs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drive
的用法示例。
在下文中一共展示了Drive::GetInputs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OperatorControl
//
// Main Tele Operator Mode function. This function is called once, therefore a while loop that checks IsOperatorControl and IsEnabled is used
// to maintain control until the end of tele operator mode
//
void OperatorControl()
{
//myRobot.SetSafetyEnabled(true);
timer->Start();
Relay* reddlight = new Relay(4);
//Timer* lighttimer = new Timer();
//lighttimer->Start();
while (IsOperatorControl() && IsEnabled())
{
reddlight->Set(reddlight->kForward);
/*
if (lighttimer->Get()<=0.5) {
reddlight->Set(reddlight->kForward);
}
else if(lighttimer->Get()<1){
reddlight->Set(reddlight->kOff);
}
else {
lighttimer->Reset();
}
*/
//
// Get inputs
//
driverInput->GetInputs();
drive->GetInputs();
catapult->GetInputs();
feeder->GetInputs();
//
// Pass values between components as necessary
//
//catapult->SetSafeToFire(feeder->GetAngle()<95);
//
// Execute one step on each component
//
drive->ExecStep();
catapult->ExecStep();
feeder->ExecStep();
//
// Set Outputs on all components
//
catapult->SetOutputs();
feeder->SetOutputs();
//
// Wait for step timer to expire. This allows us to control the amount of time each step takes. Afterwards, restart the
// timer for the next loop
//
while (timer->Get()<(PERIOD_IN_SECONDS));
timer->Reset();
}
}