/** * 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(); } } }
/** * 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); }
public DriveController() { safetyHelper = new MotorSafetyHelper(this); safetyHelper.setSafetyEnabled(true); }
private void setupMotorSafety() { m_safetyHelper = new MotorSafetyHelper(this); m_safetyHelper.setExpiration(kDefaultExpirationTime); m_safetyHelper.setSafetyEnabled(true); }