Class TalonFXSensorCollection

java.lang.Object
com.ctre.phoenix.motorcontrol.TalonFXSensorCollection

@Deprecated(since="2024",
            forRemoval=true)
public class TalonFXSensorCollection
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
This device's Phoenix 5 API is deprecated for removal in the 2025 season. Users should update to Phoenix 6 firmware and migrate to the Phoenix 6 API. A migration guide is available at https://v6.docs.ctr-electronics.com/en/stable/docs/migration/migration-guide/index.html.

If the Phoenix 5 API must be used for this device, the device must have 22.X firmware. This firmware is available in Tuner X after selecting Phoenix 5 in the firmware year dropdown.

Collection of sensors available to the Talon FX.

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 getTalonFXSensorCollection() routine inside your motor controller to create a sensor collection.

  • Constructor Summary

    Constructors 
    Constructor Description
    TalonFXSensorCollection​(BaseTalon motorController)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructor for SensorCollection
  • Method Summary

    Modifier and Type Method Description
    double getIntegratedSensorAbsolutePosition()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the IntegratedSensor absolute position of the Talon FX, regardless of whether it is actually being used for feedback.
    double getIntegratedSensorPosition()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the IntegratedSensor position of the Talon FX, regardless of whether it is actually being used for feedback.
    double getIntegratedSensorVelocity()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the IntegratedSensor velocity of the Talon FX, regardless of whether it is actually being used for feedback.
    int isFwdLimitSwitchClosed()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Is forward limit switch closed.
    int isRevLimitSwitchClosed()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Is reverse limit switch closed.
    ErrorCode setIntegratedSensorPosition​(double newPosition, int timeoutMs)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the IntegratedSensor reported position.
    ErrorCode setIntegratedSensorPositionToAbsolute​(int timeoutMs)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the IntegratedSensor reported position based on the absolute position.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TalonFXSensorCollection

      public TalonFXSensorCollection​(BaseTalon motorController)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor for SensorCollection
      Parameters:
      motorController - Motor Controller to connect Collection to
  • Method Details

    • getIntegratedSensorPosition

      public double getIntegratedSensorPosition()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the IntegratedSensor position of the Talon FX, regardless of whether it is actually being used for feedback. The units are 2048 per rotation. Note : Future versions of software may support scaling features (rotations, radians, degrees, etc) depending on the configuration.

      This method relies on the Status 21 message, which has a default period of 240ms. For more information, see: https://phoenix-documentation.readthedocs.io/en/latest/ch18_CommonAPI.html

      Returns:
      the IntegratedSensor position.
    • getIntegratedSensorAbsolutePosition

      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the IntegratedSensor absolute position of the Talon FX, regardless of whether it is actually being used for feedback. This will be within one rotation (2048 units). The signage and range will depend on the configuration. Note : Future versions of software may support scaling features (rotations, radians, degrees, etc) depending on the configuration.

      This method relies on the Status 21 message, which has a default period of 240ms. For more information, see: https://phoenix-documentation.readthedocs.io/en/latest/ch18_CommonAPI.html

      Returns:
      the IntegratedSensor absolute position.
    • getIntegratedSensorVelocity

      public double getIntegratedSensorVelocity()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the IntegratedSensor velocity of the Talon FX, regardless of whether it is actually being used for feedback. One unit represents one position unit per 100ms (2048 position units per 100ms). The signage and range will depend on the configuration. Note : Future versions of software may support scaling features (rotations, radians, degrees, etc) depending on the configuration.

      This method relies on the Status 21 message, which has a default period of 240ms. For more information, see: https://phoenix-documentation.readthedocs.io/en/latest/ch18_CommonAPI.html

      Returns:
      the IntegratedSensor velocity.
    • setIntegratedSensorPosition

      public ErrorCode setIntegratedSensorPosition​(double newPosition, int timeoutMs)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the IntegratedSensor reported position. Typically this is used to "zero" the sensor. This only works with IntegratedSensor. To set the selected sensor position regardless of what type it is, see SetSelectedSensorPosition in the motor controller class.
      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:
      error code.
    • setIntegratedSensorPositionToAbsolute

      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the IntegratedSensor reported position based on the absolute position. This can also be done automatically on power boot depending on configuration.
      Parameters:
      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:
      error code.
    • isFwdLimitSwitchClosed

      public int isFwdLimitSwitchClosed()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Is forward limit switch closed.

      This method relies on the Status 1 message, which has a default period of 10ms. For more information, see: https://phoenix-documentation.readthedocs.io/en/latest/ch18_CommonAPI.html

      Returns:
      '1' iff forward limit switch is closed, 0 iff switch is open. This function works regardless if limit switch feature is enabled. Remote limit features do not impact this routine.
    • isRevLimitSwitchClosed

      public int isRevLimitSwitchClosed()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Is reverse limit switch closed.

      This method relies on the Status 1 message, which has a default period of 10ms. For more information, see: https://phoenix-documentation.readthedocs.io/en/latest/ch18_CommonAPI.html

      Returns:
      '1' iff reverse limit switch is closed, 0 iff switch is open. This function works regardless if limit switch feature is enabled. Remote limit features do not impact this routine.