Java 类edu.wpi.first.wpilibj.MotorSafetyHelper 实例源码

项目:RobotCode2018    文件:DriverStationF.java   
/**
 * 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(); }
    }
}
项目:RobotCode2018    文件:WPI_TalonSRXF.java   
/**
 * 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);
}
项目:CMonster2015    文件:DriveController.java   
public DriveController() {
    safetyHelper = new MotorSafetyHelper(this);
    safetyHelper.setSafetyEnabled(true);
}
项目:aeronautical-facilitation    文件:RobotDrive6.java   
private void setupMotorSafety() {
    m_safetyHelper = new MotorSafetyHelper(this);
    m_safetyHelper.setExpiration(kDefaultExpirationTime);
    m_safetyHelper.setSafetyEnabled(true);
}
项目:Felix-2014    文件:RobotDriveSteering.java   
private void setupMotorSafety() {
    m_safetyHelper = new MotorSafetyHelper(this);
    m_safetyHelper.setExpiration(kDefaultExpirationTime);
    m_safetyHelper.setSafetyEnabled(true);
}
项目:CMonster2014    文件:DriveController.java   
public DriveController() {
    safetyHelper = new MotorSafetyHelper(this);
    safetyHelper.setSafetyEnabled(true);
}