CTRE Phoenix C++ 5.33.1
ctre::phoenix Namespace Reference

namespace phoenix More...

Namespaces

namespace  led
 
namespace  legacy_string_util
 
namespace  motion
 
namespace  motorcontrol
 namespace motorcontrol
 
namespace  music
 
namespace  platform
 platform namespace
 
namespace  sensors
 sensors namespace
 
namespace  signals
 signals namespace
 
namespace  tasking
 tasking namespace
 
namespace  unmanaged
 unmanaged namespace
 

Classes

class  CANBusAddressable
 Simple address holder. More...
 
class  CANifier
 CTRE CANifier. More...
 
struct  CANifierConfiguration
 Configurables available to CANifier. More...
 
struct  CANifierConfigUtils
 Util class to help with configuring CANifier. More...
 
struct  CANifierFaults
 Faults available to CANifier (Currently has none) More...
 
struct  CANifierStickyFaults
 Sticky Faults for CANifier (Currently has none) More...
 
class  CANifierVelocityMeasPeriodRoutines
 Class to handle routines specific to VelocityMeasPeriod. More...
 
class  CTRLogger
 Object to handle error logging. More...
 
struct  CustomParamConfiguration
 Configurables for any custom param configs. More...
 
struct  CustomParamConfigUtil
 Util class to help custom configs. More...
 
class  ErrorCollection
 
class  HsvToRgb
 Class to convert Hue, Saturation, Value to Red, Green, Blue. More...
 
class  LinearInterpolation
 Class to calculate linear interpolation. More...
 
class  RCRadio3Ch
 Class to convert RC PWM signals into CAN signals using CANifier. More...
 
class  Stopwatch
 Stopwatch to track time in milliseconds. More...
 
class  Utilities
 Class with basic utility methods. More...
 
class  WPI_CallbackHelper
 

Enumerations

enum  ParamEnum : uint32_t {
  eOnBoot_BrakeMode = 31 , eQuadFilterEn = 91 , eQuadIdxPolarity = 108 , eMotionProfileHasUnderrunErr = 119 ,
  eMotionProfileTrajectoryPointDurationMs = 120 , eMotionProfileTrajectoryInterpolDis = 121 , eStatusFramePeriod = 300 , eOpenloopRamp = 301 ,
  eClosedloopRamp = 302 , eNeutralDeadband = 303 , ePeakPosOutput = 305 , eNominalPosOutput = 306 ,
  ePeakNegOutput = 307 , eNominalNegOutput = 308 , eProfileParamSlot_P = 310 , eProfileParamSlot_I = 311 ,
  eProfileParamSlot_D = 312 , eProfileParamSlot_F = 313 , eProfileParamSlot_IZone = 314 , eProfileParamSlot_AllowableErr = 315 ,
  eProfileParamSlot_MaxIAccum = 316 , eProfileParamSlot_PeakOutput = 317 , eClearPositionOnLimitF = 320 , eClearPositionOnLimitR = 321 ,
  eClearPositionOnQuadIdx = 322 , eSampleVelocityPeriod = 325 , eSampleVelocityWindow = 326 , eFeedbackSensorType = 330 ,
  eSelectedSensorPosition = 331 , eFeedbackNotContinuous = 332 , eRemoteSensorSource = 333 , eRemoteSensorDeviceID = 334 ,
  eSensorTerm = 335 , eRemoteSensorClosedLoopDisableNeutralOnLOS = 336 , ePIDLoopPolarity = 337 , ePIDLoopPeriod = 338 ,
  eSelectedSensorCoefficient = 339 , eForwardSoftLimitThreshold = 340 , eReverseSoftLimitThreshold = 341 , eForwardSoftLimitEnable = 342 ,
  eReverseSoftLimitEnable = 343 , eNominalBatteryVoltage = 350 , eBatteryVoltageFilterSize = 351 , eContinuousCurrentLimitAmps = 360 ,
  ePeakCurrentLimitMs = 361 , ePeakCurrentLimitAmps = 362 , eCurrLimit_Amps = eContinuousCurrentLimitAmps , eCurrThres_Amps = ePeakCurrentLimitAmps ,
  eCurrEnable = 363 , eCurrThres_Ms = 364 , eClosedLoopIAccum = 370 , eCustomParam = 380 ,
  eStickyFaults = 390 , eAnalogPosition = 400 , eQuadraturePosition = 401 , ePulseWidthPosition = 402 ,
  eIntegratedSensor = 403 , eMotMag_Accel = 410 , eMotMag_VelCruise = 411 , eMotMag_SCurveLevel = 412 ,
  eLimitSwitchSource = 421 , eLimitSwitchNormClosedAndDis = 422 , eLimitSwitchDisableNeutralOnLOS = 423 , eLimitSwitchRemoteDevID = 424 ,
  eSoftLimitDisableNeutralOnLOS = 425 , ePulseWidthPeriod_EdgesPerRot = 430 , ePulseWidthPeriod_FilterWindowSz = 431 , eYawOffset = 160 ,
  eCompassOffset = 161 , eBetaGain = 162 , eEnableCompassFusion = 163 , eGyroNoMotionCal = 164 ,
  eEnterCalibration = 165 , eFusedHeadingOffset = 166 , eStatusFrameRate = 169 , eAccumZ = 170 ,
  eTempCompDisable = 171 , eMotionMeas_tap_threshX = 172 , eMotionMeas_tap_threshY = 173 , eMotionMeas_tap_threshZ = 174 ,
  eMotionMeas_tap_count = 175 , eMotionMeas_tap_time = 176 , eMotionMeas_tap_time_multi = 177 , eMotionMeas_shake_reject_thresh = 178 ,
  eMotionMeas_shake_reject_time = 179 , eMotionMeas_shake_reject_timeout = 180 , eUnitString = 442 , eFeedbackTimeBase = 443 ,
  eDefaultConfig = 500 , eFastWriteCount = 501 , eWriteCount = 502 , eReserved1 = 555 ,
  eMotorCommutation = 650 , eSensorInitStrategy = 700 , eSensorDirection , eMagnetOffset ,
  eSensorSync , eAbsSensorRange , eChangeCompassUse = 800 , eRestartKalman ,
  eAccNoiseAmplificationGain , eMagNoiseAmplificationGain , eGyrNoiseAmplificationGain , eMaxAccKg ,
  eMaxMagKg , eGyroBias , eAccelOffsets , eMagCal ,
  eMagCalSlot , eMagCalRunning , eGyrResolution , eAccelKalmanBiasGain ,
  eMagKalmanBiasGain , eTempCalRunning , eApplyTempCal , eClearTempCal ,
  eDontRunThermComp , eChangeHeatOutput , eSetNoMotionCalDisable , eClearMagCal ,
  eSetGyrSensitivity , eSetVsenseScalar , eConfigMountPoseYaw , eConfigMountPosePitch ,
  eConfigMountPoseRoll , eConfigAccelScalar , eConfigGyroScalarX , eConfigGyroScalarY ,
  eConfigGyroScalarZ , eCustomParam0 , eCustomParam1 , eLEDStripType = 900 ,
  eLossOfSignalBehavior , eBrightnessCoefficient , eStatusLedState , eVBatOutput ,
  eV5Enabled
}
 Signal enumeration for generic signal access. More...
 
enum  CANifierVelocityMeasPeriod {
  Period_1Ms = 1 , Period_2Ms = 2 , Period_5Ms = 5 , Period_10Ms = 10 ,
  Period_20Ms = 20 , Period_25Ms = 25 , Period_50Ms = 50 , Period_100Ms = 100
}
 Enum for velocity periods used for CANifier. More...
 
enum  CANifierStatusFrame {
  CANifierStatusFrame_Status_1_General = 0x041400 , CANifierStatusFrame_Status_2_General = 0x041440 , CANifierStatusFrame_Status_3_PwmInputs0 = 0x041480 , CANifierStatusFrame_Status_4_PwmInputs1 = 0x0414C0 ,
  CANifierStatusFrame_Status_5_PwmInputs2 = 0x041500 , CANifierStatusFrame_Status_6_PwmInputs3 = 0x041540 , CANifierStatusFrame_Status_8_Misc = 0x0415C0
}
 Enumerated type for status frame types. More...
 
enum  AutocacheState { DISABLED = 0 , ENABLED = 1 }
 Keeps track of cache state. More...
 
enum  CANifierControlFrame { CANifier_Control_1_General = 0x03040000 , CANifier_Control_2_PwmOutput = 0x03040040 }
 Enumerated type for status frame types. More...
 
enum  ErrorCode {
  OK = 0 , OKAY = 0 , CAN_MSG_STALE = 1 , CAN_TX_FULL = -1 ,
  TxFailed = -1 , InvalidParamValue = -2 , CAN_INVALID_PARAM = -2 , RxTimeout = -3 ,
  CAN_MSG_NOT_FOUND = -3 , TxTimeout = -4 , CAN_NO_MORE_TX_JOBS = -4 , UnexpectedArbId = -5 ,
  CAN_NO_SESSIONS_AVAIL = -5 , BufferFull = +6 , CAN_OVERFLOW = -6 , SensorNotPresent = -7 ,
  FirmwareTooOld = -8 , CouldNotChangePeriod = -9 , BufferFailure = -10 , FirwmwareNonFRC = -11 ,
  GeneralError = -100 , GENERAL_ERROR = -100 , SIG_NOT_UPDATED = -200 , SigNotUpdated = -200 ,
  NotAllPIDValuesUpdated = -201 , GEN_PORT_ERROR = -300 , PORT_MODULE_TYPE_MISMATCH = -301 , GEN_MODULE_ERROR = -400 ,
  MODULE_NOT_INIT_SET_ERROR = -401 , MODULE_NOT_INIT_GET_ERROR = -402 , WheelRadiusTooSmall = -500 , TicksPerRevZero = -501 ,
  DistanceBetweenWheelsTooSmall = -502 , GainsAreNotSet = -503 , WrongRemoteLimitSwitchSource = -504 , DoubleVoltageCompensatingWPI = -505 ,
  CANdleAnimSlotOutOfBounds = -506 , IncompatibleMode = -600 , InvalidHandle = -601 , FeatureRequiresHigherFirm = -700 ,
  MotorControllerFeatureRequiresHigherFirm = -701 , TalonFeatureRequiresHigherFirm = MotorControllerFeatureRequiresHigherFirm , ConfigFactoryDefaultRequiresHigherFirm = -702 , ConfigMotionSCurveRequiresHigherFirm = -703 ,
  TalonFXFirmwarePreVBatDetect = -704 , CANdleAnimationsRequireHigherFirm = -705 , LibraryCouldNotBeLoaded = -800 , MissingRoutineInLibrary = -801 ,
  ResourceNotAvailable = -802 , MusicFileNotFound = -900 , MusicFileWrongSize = -901 , MusicFileTooNew = -902 ,
  MusicFileInvalid = -903 , InvalidOrchestraAction = -904 , MusicFileTooOld = -905 , MusicInterrupted = -906 ,
  MusicNotSupported = -907 , kInvalidInterface = -1000 , kInvalidGuid = -1001 , kInvalidClass = -1002 ,
  kInvalidProtocol = -1003 , kInvalidPath = -1004 , kGeneralWinUsbError = -1005 , kFailedSetup = -1006 ,
  kListenFailed = -1007 , kSendFailed = -1008 , kReceiveFailed = -1009 , kInvalidRespFormat = -1010 ,
  kWinUsbInitFailed = -1011 , kWinUsbQueryFailed = -1012 , kWinUsbGeneralError = -1013 , kAccessDenied = -1014 ,
  kFirmwareInvalidResponse = -1015 , PulseWidthSensorNotPresent = +10 , GeneralWarning = 100 , FeatureNotSupported = 101 ,
  NotImplemented = 102 , FirmVersionCouldNotBeRetrieved = 103 , FeaturesNotAvailableYet = 104 , ControlModeNotValid = 105 ,
  ControlModeNotSupportedYet = 106 , CascadedPIDNotSupporteYet = 107 , AuxiliaryPIDNotSupportedYet = 107 , RemoteSensorsNotSupportedYet = 108 ,
  MotProfFirmThreshold = 109 , MotProfFirmThreshold2 = 110 , SimDeviceNotFound = 200 , SimPhysicsTypeNotSupported = 201 ,
  SimDeviceAlreadyExists = 202
}
 

Detailed Description

namespace phoenix

Enumeration Type Documentation

◆ AutocacheState

Keeps track of cache state.

Enumerator
DISABLED 

Disabled cache.

ENABLED 

Enabled cache.

◆ CANifierControlFrame

Enumerated type for status frame types.

Enumerator
CANifier_Control_1_General 
CANifier_Control_2_PwmOutput 

◆ CANifierStatusFrame

Enumerated type for status frame types.

Enumerator
CANifierStatusFrame_Status_1_General 
CANifierStatusFrame_Status_2_General 
CANifierStatusFrame_Status_3_PwmInputs0 
CANifierStatusFrame_Status_4_PwmInputs1 
CANifierStatusFrame_Status_5_PwmInputs2 
CANifierStatusFrame_Status_6_PwmInputs3 
CANifierStatusFrame_Status_8_Misc 

◆ CANifierVelocityMeasPeriod

Enum for velocity periods used for CANifier.

Enumerator
Period_1Ms 

1ms velocity measurement period

Period_2Ms 

2ms velocity measurement period

Period_5Ms 

5ms velocity measurement period

Period_10Ms 

10ms velocity measurement period

Period_20Ms 

20ms velocity measurement period

Period_25Ms 

25ms velocity measurement period

Period_50Ms 

50ms velocity measurement period

Period_100Ms 

100ms velocity measurement period

◆ ErrorCode

Enumerator
OK 
OKAY 

No Error - Function executed as expected.

CAN_MSG_STALE 
CAN_TX_FULL 
TxFailed 

Could not transmit the CAN frame.

InvalidParamValue 

Caller passed an invalid param.

CAN_INVALID_PARAM 
RxTimeout 

CAN frame has not been received within specified period of time.

CAN_MSG_NOT_FOUND 
TxTimeout 

Not used.

CAN_NO_MORE_TX_JOBS 
UnexpectedArbId 

Specified CAN Id is invalid.

CAN_NO_SESSIONS_AVAIL 
BufferFull 

Caller attempted to insert data into a buffer that is full.

CAN_OVERFLOW 
SensorNotPresent 

Sensor is not present.

FirmwareTooOld 
CouldNotChangePeriod 
BufferFailure 
FirwmwareNonFRC 
GeneralError 

User Specified General Error.

GENERAL_ERROR 
SIG_NOT_UPDATED 
SigNotUpdated 

Have not received an value response for signal.

NotAllPIDValuesUpdated 
GEN_PORT_ERROR 
PORT_MODULE_TYPE_MISMATCH 
GEN_MODULE_ERROR 
MODULE_NOT_INIT_SET_ERROR 
MODULE_NOT_INIT_GET_ERROR 
WheelRadiusTooSmall 
TicksPerRevZero 
DistanceBetweenWheelsTooSmall 
GainsAreNotSet 
WrongRemoteLimitSwitchSource 
DoubleVoltageCompensatingWPI 
CANdleAnimSlotOutOfBounds 
IncompatibleMode 
InvalidHandle 

Handle does not match stored map of handles.

FeatureRequiresHigherFirm 
MotorControllerFeatureRequiresHigherFirm 
TalonFeatureRequiresHigherFirm 
ConfigFactoryDefaultRequiresHigherFirm 
ConfigMotionSCurveRequiresHigherFirm 
TalonFXFirmwarePreVBatDetect 
CANdleAnimationsRequireHigherFirm 
LibraryCouldNotBeLoaded 
MissingRoutineInLibrary 
ResourceNotAvailable 
MusicFileNotFound 
MusicFileWrongSize 
MusicFileTooNew 
MusicFileInvalid 
InvalidOrchestraAction 
MusicFileTooOld 
MusicInterrupted 
MusicNotSupported 
kInvalidInterface 
kInvalidGuid 
kInvalidClass 
kInvalidProtocol 
kInvalidPath 
kGeneralWinUsbError 
kFailedSetup 
kListenFailed 
kSendFailed 
kReceiveFailed 
kInvalidRespFormat 
kWinUsbInitFailed 
kWinUsbQueryFailed 
kWinUsbGeneralError 
kAccessDenied 
kFirmwareInvalidResponse 
PulseWidthSensorNotPresent 

Special Code for "isSensorPresent".

GeneralWarning 
FeatureNotSupported 
NotImplemented 
FirmVersionCouldNotBeRetrieved 
FeaturesNotAvailableYet 
ControlModeNotValid 
ControlModeNotSupportedYet 
CascadedPIDNotSupporteYet 
AuxiliaryPIDNotSupportedYet 
RemoteSensorsNotSupportedYet 
MotProfFirmThreshold 
MotProfFirmThreshold2 
SimDeviceNotFound 
SimPhysicsTypeNotSupported 
SimDeviceAlreadyExists 

◆ ParamEnum

enum ctre::phoenix::ParamEnum : uint32_t

Signal enumeration for generic signal access.

Enumerator
eOnBoot_BrakeMode 
eQuadFilterEn 
eQuadIdxPolarity 
eMotionProfileHasUnderrunErr 
eMotionProfileTrajectoryPointDurationMs 
eMotionProfileTrajectoryInterpolDis 
eStatusFramePeriod 
eOpenloopRamp 
eClosedloopRamp 
eNeutralDeadband 
ePeakPosOutput 
eNominalPosOutput 
ePeakNegOutput 
eNominalNegOutput 
eProfileParamSlot_P 
eProfileParamSlot_I 
eProfileParamSlot_D 
eProfileParamSlot_F 
eProfileParamSlot_IZone 
eProfileParamSlot_AllowableErr 
eProfileParamSlot_MaxIAccum 
eProfileParamSlot_PeakOutput 
eClearPositionOnLimitF 
eClearPositionOnLimitR 
eClearPositionOnQuadIdx 
eSampleVelocityPeriod 
eSampleVelocityWindow 
eFeedbackSensorType 
eSelectedSensorPosition 
eFeedbackNotContinuous 
eRemoteSensorSource 
eRemoteSensorDeviceID 
eSensorTerm 
eRemoteSensorClosedLoopDisableNeutralOnLOS 
ePIDLoopPolarity 
ePIDLoopPeriod 
eSelectedSensorCoefficient 
eForwardSoftLimitThreshold 
eReverseSoftLimitThreshold 
eForwardSoftLimitEnable 
eReverseSoftLimitEnable 
eNominalBatteryVoltage 
eBatteryVoltageFilterSize 
eContinuousCurrentLimitAmps 
ePeakCurrentLimitMs 
ePeakCurrentLimitAmps 
eCurrLimit_Amps 
eCurrThres_Amps 
eCurrEnable 
eCurrThres_Ms 
eClosedLoopIAccum 
eCustomParam 
eStickyFaults 
eAnalogPosition 
eQuadraturePosition 
ePulseWidthPosition 
eIntegratedSensor 
eMotMag_Accel 
eMotMag_VelCruise 
eMotMag_SCurveLevel 
eLimitSwitchSource 
eLimitSwitchNormClosedAndDis 
eLimitSwitchDisableNeutralOnLOS 
eLimitSwitchRemoteDevID 
eSoftLimitDisableNeutralOnLOS 
ePulseWidthPeriod_EdgesPerRot 
ePulseWidthPeriod_FilterWindowSz 
eYawOffset 
eCompassOffset 
eBetaGain 
eEnableCompassFusion 
eGyroNoMotionCal 
eEnterCalibration 
eFusedHeadingOffset 
eStatusFrameRate 
eAccumZ 
eTempCompDisable 
eMotionMeas_tap_threshX 
eMotionMeas_tap_threshY 
eMotionMeas_tap_threshZ 
eMotionMeas_tap_count 
eMotionMeas_tap_time 
eMotionMeas_tap_time_multi 
eMotionMeas_shake_reject_thresh 
eMotionMeas_shake_reject_time 
eMotionMeas_shake_reject_timeout 
eUnitString 
eFeedbackTimeBase 
eDefaultConfig 
eFastWriteCount 
eWriteCount 
eReserved1 
eMotorCommutation 
eSensorInitStrategy 
eSensorDirection 
eMagnetOffset 
eSensorSync 
eAbsSensorRange 
eChangeCompassUse 
eRestartKalman 
eAccNoiseAmplificationGain 
eMagNoiseAmplificationGain 
eGyrNoiseAmplificationGain 
eMaxAccKg 
eMaxMagKg 
eGyroBias 
eAccelOffsets 
eMagCal 
eMagCalSlot 
eMagCalRunning 
eGyrResolution 
eAccelKalmanBiasGain 
eMagKalmanBiasGain 
eTempCalRunning 
eApplyTempCal 
eClearTempCal 
eDontRunThermComp 
eChangeHeatOutput 
eSetNoMotionCalDisable 
eClearMagCal 
eSetGyrSensitivity 
eSetVsenseScalar 
eConfigMountPoseYaw 
eConfigMountPosePitch 
eConfigMountPoseRoll 
eConfigAccelScalar 
eConfigGyroScalarX 
eConfigGyroScalarY 
eConfigGyroScalarZ 
eCustomParam0 
eCustomParam1 
eLEDStripType 
eLossOfSignalBehavior 
eBrightnessCoefficient 
eStatusLedState 
eVBatOutput 
eV5Enabled