/** * TODO documentation (see CANJaguar.cpp) */ void CANTalon::SetControlMode(CANSpeedController::ControlMode mode) { if (m_controlMode == mode) { /* we already are in this mode, don't perform disable workaround */ } else { ApplyControlMode(mode); } }
/** * Constructor for the CANTalon device. * @param deviceNumber The CAN ID of the Talon SRX */ CANTalon::CANTalon(int deviceNumber) : m_deviceNumber(deviceNumber), m_impl(new CanTalonSRX(deviceNumber)), m_safetyHelper(new MotorSafetyHelper(this)) { ApplyControlMode(m_controlMode); m_impl->SetProfileSlotSelect(m_profile); m_isInverted = false; }
/** * Constructor for the CANTalon device. * @param deviceNumber The CAN ID of the Talon SRX * @param controlPeriodMs The period in ms to send the CAN control frame. * Period is bounded to [1ms, 95ms]. */ CANTalon::CANTalon(int deviceNumber,int controlPeriodMs) : m_deviceNumber(deviceNumber) , m_impl(new CanTalonSRX(deviceNumber,controlPeriodMs)) /* bounded underneath to be within [1 ms,95 ms] */ , m_safetyHelper(new MotorSafetyHelper(this)) , m_profile(0) , m_controlEnabled(true) , m_controlMode(kPercentVbus) , m_setPoint(0) { ApplyControlMode(m_controlMode); m_impl->SetProfileSlotSelect(m_profile); }
/** * Constructor for the CANTalon device. * @param deviceNumber The CAN ID of the Talon SRX */ CANTalon::CANTalon(int deviceNumber) : m_deviceNumber(deviceNumber) , m_impl(new CanTalonSRX(deviceNumber)) , m_safetyHelper(new MotorSafetyHelper(this)) , m_profile(0) , m_controlEnabled(true) , m_controlMode(kPercentVbus) , m_setPoint(0) { ApplyControlMode(m_controlMode); m_impl->SetProfileSlotSelect(m_profile); }