本文整理汇总了C++中Encoder::SetMinRate方法的典型用法代码示例。如果您正苦于以下问题:C++ Encoder::SetMinRate方法的具体用法?C++ Encoder::SetMinRate怎么用?C++ Encoder::SetMinRate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encoder
的用法示例。
在下文中一共展示了Encoder::SetMinRate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RobotInit
void RobotInit ()
{
lw = LiveWindow::GetInstance();
CameraServer::GetInstance()->SetQuality(50);
//the camera name (ex "cam0") can be found through the roborio web interface
CameraServer::GetInstance()->StartAutomaticCapture("cam1");
AutonState = 0;
ballarm.Reset();
ballarm.SetMaxPeriod(.01);
ballarm.SetMinRate(.02);
ballarm.SetDistancePerPulse(.9);
gyroOne.Calibrate();
UpdateActuatorCmnds(0,0,false,false,false,false,false,false,false,0,0,0,0,0);
UpdateSmartDashboad(false,
false,
false,
false,
false,
0,
0,
0,
0,
0,
0,
0,
0,
0);
}
示例2: TeleopInit
void TeleopInit()
{
// Initialize the encoder
sampleEncoder = new Encoder(0, 1, false, Encoder::EncodingType::k4X);
sampleEncoder->SetMaxPeriod(.1);
sampleEncoder->SetMinRate(10);
sampleEncoder->SetDistancePerPulse(5);
sampleEncoder->SetReverseDirection(true);
sampleEncoder->SetSamplesToAverage(7);
// Initialize the joystick
joystick = new Joystick(0);
// Initialize the motor
motor = new Victor(9);
// Initialize the gear tooth counter
toothTrigger = new AnalogTrigger(3);
toothTrigger->SetLimitsRaw(250, 3600);
gearToothCounter = new Counter(toothTrigger);
// gearToothCounter->SetUpDownCounterMode();
}
示例3: SetMinEncoderRate
/**
* Set the minimum rate of the device before the hardware reports it stopped.
*
* @param minRate The minimum rate. The units are in distance per second as scaled by the value from SetEncoderDistancePerPulse().
*
* @param aSlot The digital module slot for the A Channel on the encoder
* @param aChannel The channel on the digital module for the A Channel of the encoder
* @param bSlot The digital module slot for the B Channel on the encoder
* @param bChannel The channel on the digital module for the B Channel of the encoder
*/
void SetMinEncoderRate(UINT32 aSlot, UINT32 aChannel, UINT32 bSlot, UINT32 bChannel, double minRate)
{
Encoder *encoder = AllocateEncoder(aSlot, aChannel, bSlot, bChannel);
if (encoder != NULL)
encoder->SetMinRate(minRate);
}