本文整理汇总了Java中edu.wpi.first.wpilibj.MotorSafetyHelper类的典型用法代码示例。如果您正苦于以下问题:Java MotorSafetyHelper类的具体用法?Java MotorSafetyHelper怎么用?Java MotorSafetyHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MotorSafetyHelper类属于edu.wpi.first.wpilibj包,在下文中一共展示了MotorSafetyHelper类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import edu.wpi.first.wpilibj.MotorSafetyHelper; //导入依赖的package包/类
/**
* Provides the service routine for the DS polling m_thread.
*/
private void run()
{
int safetyCounter = 0;
while(m_threadKeepAlive)
{
HAL.waitForDSData();
getData();
if(isDisabled()) { safetyCounter = 0; }
if(++safetyCounter >= 4)
{
MotorSafetyHelper.checkMotors();
safetyCounter = 0;
}
if(m_userInDisabled) { HAL.observeUserProgramDisabled(); }
if(m_userInAutonomous) { HAL.observeUserProgramAutonomous(); }
if(m_userInTeleop) { HAL.observeUserProgramTeleop(); }
if(m_userInTest) { HAL.observeUserProgramTest(); }
}
}
示例2: WPI_TalonSRXF
import edu.wpi.first.wpilibj.MotorSafetyHelper; //导入依赖的package包/类
/**
* Constructor
*/
public WPI_TalonSRXF(int deviceNumber)
{
super(deviceNumber);
HAL.report(66, deviceNumber + 1);
m_description = "Talon SRX " + deviceNumber;
/* prep motor safety */
m_safetyHelper = new MotorSafetyHelper(this);
m_safetyHelper.setExpiration(0.0);
m_safetyHelper.setSafetyEnabled(false);
LiveWindow.add(this);
setName("Talon SRX ", deviceNumber);
}
示例3: DriveController
import edu.wpi.first.wpilibj.MotorSafetyHelper; //导入依赖的package包/类
public DriveController() {
safetyHelper = new MotorSafetyHelper(this);
safetyHelper.setSafetyEnabled(true);
}
示例4: setupMotorSafety
import edu.wpi.first.wpilibj.MotorSafetyHelper; //导入依赖的package包/类
private void setupMotorSafety() {
m_safetyHelper = new MotorSafetyHelper(this);
m_safetyHelper.setExpiration(kDefaultExpirationTime);
m_safetyHelper.setSafetyEnabled(true);
}