SensorCollection

class phoenix5.SensorCollection(motorController: phoenix5._ctre.BaseTalon)

Bases: pybind11_object

Collection of sensors available to a motor controller.

For best performance and update-rate, we recommend using the configSelectedFeedbackSensor() and getSelectedSensor*() routines. However there are occasions where accessing raw sensor values may be useful or convenient. Particularly if you are seeding one sensor based on another, or need to circumvent sensor-phase.

Use the getSensorCollection() routine inside your motor controller to create a sensor collection.

Constructor for SensorCollection

Parameters:

motorController – Talon Motor Controller to connect Collection to

getAnalogIn() int
getAnalogInRaw() int
getAnalogInVel() int
getPinStateQuadA() int
getPinStateQuadB() int
getPinStateQuadIdx() int
getPulseWidthPosition() int
getPulseWidthRiseToFallUs() int
getPulseWidthRiseToRiseUs() int
getPulseWidthVelocity() int
getQuadraturePosition() int
getQuadratureVelocity() int
isFwdLimitSwitchClosed() int
isRevLimitSwitchClosed() int
setAnalogPosition(newPosition: int, timeoutMs: int = 0) phoenix5._ctre.ErrorCode
setPulseWidthPosition(newPosition: int, timeoutMs: int = 0) phoenix5._ctre.ErrorCode

Sets pulse width position.

Parameters:
  • newPosition – The position value to apply to the sensor.

  • timeoutMs – Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed.

Returns:

an ErrErrorCode

setQuadraturePosition(newPosition: int, timeoutMs: int = 0) phoenix5._ctre.ErrorCode
syncQuadratureWithPulseWidth(bookend0: int, bookend1: int, bCrossZeroOnInterval: bool, offset: int = 0, timeoutMs: int = 0) phoenix5._ctre.ErrorCode