本文整理汇总了C++中CANJaguar::SetSpeedMode方法的典型用法代码示例。如果您正苦于以下问题:C++ CANJaguar::SetSpeedMode方法的具体用法?C++ CANJaguar::SetSpeedMode怎么用?C++ CANJaguar::SetSpeedMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CANJaguar
的用法示例。
在下文中一共展示了CANJaguar::SetSpeedMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Configure
void CANJaguarConfiguration :: Configure ( CANJaguar & Jag )
{
Jag.DisableControl ();
Jag.ConfigMaxOutputVoltage ( MaxOutputVoltage );
Jag.SetVoltageRampRate ( VoltageRampRate );
Jag.ConfigFaultTime ( FaultTime );
Jag.ConfigNeutralMode ( NeutralMode );
Jag.ConfigLimitMode ( LimitMode );
Jag.ConfigForwardLimit ( ForwardPositionLimit );
Jag.ConfigForwardLimit ( ReversePositionLimit );
switch ( Feedback )
{
case kFeedbackType_None:
switch ( Mode )
{
case CANSpeedController :: kPercentVbus:
Jag.SetPercentMode ();
break;
case CANSpeedController :: kCurrent:
Jag.SetCurrentMode ( P, I, D );
Jag.Set ( 0 );
Jag.EnableControl ();
break;
case CANSpeedController :: kVoltage:
Jag.SetVoltageMode ();
break;
default:
Jag.SetVoltageMode ( CANJaguar :: Encoder, EncoderCounts );
Jag.ConfigMaxOutputVoltage ( 0.0 );
break;
}
break;
case kFeedbackType_Encoder:
switch ( Mode )
{
case CANSpeedController :: kPercentVbus:
Jag.SetPercentMode ( CANJaguar :: Encoder, EncoderCounts );
break;
case CANSpeedController :: kCurrent:
Jag.SetCurrentMode ( CANJaguar :: Encoder, EncoderCounts, P, I, D );
Jag.Set ( 0 );
Jag.EnableControl ();
break;
case CANSpeedController :: kSpeed:
Jag.SetSpeedMode ( CANJaguar :: Encoder, EncoderCounts, P, I, D );
Jag.Set ( 0 );
Jag.EnableControl ();
break;
case CANSpeedController :: kVoltage:
Jag.SetVoltageMode ( CANJaguar :: Encoder, EncoderCounts );
break;
default:
Jag.SetVoltageMode ( CANJaguar :: Encoder, EncoderCounts );
Jag.ConfigMaxOutputVoltage ( 0.0 );
break;
}
break;
case kFeedbackType_QuadEncoder:
switch ( Mode )
{
case CANSpeedController :: kPercentVbus:
//.........这里部分代码省略.........