Class TalonFXSimCollection

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

@Deprecated(since="2024",
            forRemoval=true)
public class TalonFXSimCollection
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 simulation commands available to a TalonFX motor controller. Use the getSimCollection() routine inside your motor controller to create the respective sim collection.
  • Constructor Summary

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

    Modifier and Type Method Description
    ErrorCode addIntegratedSensorPosition​(int dPos)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds to the simulated integrated sensor position of the TalonFX.
    ErrorCode getLastError()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the last error generated by this object.
    double getMotorOutputLeadVoltage()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the simulated output voltage across M+ and M- for the motor.
    ErrorCode setBusVoltage​(double vbat)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the simulated bus voltage of the TalonFX.
    ErrorCode setIntegratedSensorRawPosition​(int newPos)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the simulated raw integrated sensor position of the TalonFX.
    ErrorCode setIntegratedSensorVelocity​(int newVel)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the simulated integrated sensor velocity of the TalonFX.
    ErrorCode setLimitFwd​(boolean isClosed)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the simulated forward limit switch of the TalonFX.
    ErrorCode setLimitRev​(boolean isClosed)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the simulated reverse limit switch of the TalonFX.
    ErrorCode setStatorCurrent​(double currA)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the simulated stator current of the TalonFX.
    ErrorCode setSupplyCurrent​(double currA)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the simulated supply current of the TalonFX.

    Methods inherited from class java.lang.Object

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

    • TalonFXSimCollection

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

    • getLastError

      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the last error generated by this object. Not all functions return an error code but can potentially report errors. This function can be used to retrieve those error codes.
      Returns:
      Last Error Code generated by a function.
    • getMotorOutputLeadVoltage

      public double getMotorOutputLeadVoltage()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the simulated output voltage across M+ and M- for the motor.
      Returns:
      applied voltage to the motor in volts
    • setBusVoltage

      public ErrorCode setBusVoltage​(double vbat)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the simulated bus voltage of the TalonFX.

      The minimum allowed bus voltage is 4 V - values below this will be promoted to 4 V.

      Parameters:
      vbat - the bus voltage in volts
      Returns:
      error code
    • setSupplyCurrent

      public ErrorCode setSupplyCurrent​(double currA)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the simulated supply current of the TalonFX.
      Parameters:
      currA - the supply current in amps
      Returns:
      error code
    • setStatorCurrent

      public ErrorCode setStatorCurrent​(double currA)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the simulated stator current of the TalonFX.
      Parameters:
      currA - the stator current in amps
      Returns:
      error code
    • setLimitFwd

      public ErrorCode setLimitFwd​(boolean isClosed)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the simulated forward limit switch of the TalonFX.
      Parameters:
      isClosed - true if the limit switch is closed
      Returns:
      error code
    • setLimitRev

      public ErrorCode setLimitRev​(boolean isClosed)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the simulated reverse limit switch of the TalonFX.
      Parameters:
      isClosed - true if the limit switch is closed
      Returns:
      error code
    • setIntegratedSensorRawPosition

      public ErrorCode setIntegratedSensorRawPosition​(int newPos)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the simulated raw integrated sensor position of the TalonFX.

      The TalonFX integrates this to calculate the true reported integrated sensor position.

      When using the WPI Sim GUI, you will notice a readonly 'position' and settable 'rawPositionInput'. The readonly signal is the emulated position which will match self-test in Tuner and the hardware API. Changes to 'rawPositionInput' will be integrated into the emulated position. This way a simulator can modify the position without overriding your hardware API calls for home-ing your sensor.

      Inputs to this function over time should be continuous, as user calls of setSelectedSensorPosition() and setIntegratedSensorPosition() will be accounted for in the calculation.

      Parameters:
      newPos - the new raw position in native units
      Returns:
      error code
    • addIntegratedSensorPosition

      public ErrorCode addIntegratedSensorPosition​(int dPos)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds to the simulated integrated sensor position of the TalonFX.
      Parameters:
      dPos - the change in position in native units
      Returns:
      error code
    • setIntegratedSensorVelocity

      public ErrorCode setIntegratedSensorVelocity​(int newVel)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the simulated integrated sensor velocity of the TalonFX.
      Parameters:
      newVel - the new velocity in native units per 100ms
      Returns:
      error code