Class TalonFX

All Implemented Interfaces:
Sendable, MotorController, AutoCloseable

@Deprecated(forRemoval=true)
public class TalonFX
extends CoreTalonFX
implements MotorController, Sendable, AutoCloseable
Deprecated, for removal: This API element is subject to removal in a future version.
Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.
  • Field Details

  • Constructor Details

    • TalonFX

      @Deprecated(forRemoval=true) public TalonFX​(int deviceId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.
      Constructs a new Talon FX motor controller object.

      Constructs the device using the default CAN bus for the system:

      • "rio" on roboRIO
      • "can0" on Linux
      • "*" on Windows
      Parameters:
      deviceId - ID of the device, as configured in Phoenix Tuner.
    • TalonFX

      @Deprecated(forRemoval=true) public TalonFX​(int deviceId, String canbus)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.
      Constructs a new Talon FX motor controller object.
      Parameters:
      deviceId - ID of the device, as configured in Phoenix Tuner.
      canbus - Name of the CAN bus this device is on. Possible CAN bus strings are:
      • "rio" for the native roboRIO CAN bus
      • CANivore name or serial number
      • SocketCAN interface (non-FRC Linux only)
      • "*" for any CANivore seen by the program
      • empty string (default) to select the default for the system:
        • "rio" on roboRIO
        • "can0" on Linux
        • "*" on Windows
  • Method Details

    • close

      public void close()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      close in interface AutoCloseable
    • set

      public void set​(double speed)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Common interface for setting the speed of a motor controller.
      Specified by:
      set in interface MotorController
      Parameters:
      speed - The speed to set. Value should be between -1.0 and 1.0.
    • setVoltage

      public void setVoltage​(double volts)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Common interface for seting the direct voltage output of a motor controller.
      Specified by:
      setVoltage in interface MotorController
      Parameters:
      volts - The voltage to output.
    • get

      public double get()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Common interface for getting the current set speed of a motor controller.
      Specified by:
      get in interface MotorController
      Returns:
      The current set speed. Value is between -1.0 and 1.0.
    • setControlPrivate

      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setControlPrivate in class ParentDevice
    • disable

      public void disable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Common interface for disabling a motor controller.
      Specified by:
      disable in interface MotorController
    • stopMotor

      public void stopMotor()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Common interface to stop motor movement until set is called again.
      Specified by:
      stopMotor in interface MotorController
    • setInverted

      public void setInverted​(boolean isInverted)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Common interface for inverting direction of a motor controller.
      Specified by:
      setInverted in interface MotorController
      Parameters:
      isInverted - The state of inversion, true is inverted.
    • getInverted

      public boolean getInverted()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Common interface for returning the inversion state of a motor controller.
      Specified by:
      getInverted in interface MotorController
      Returns:
      The state of the inversion, true is inverted.
    • initSendable

      public void initSendable​(SendableBuilder builder)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      initSendable in interface Sendable
    • getDescription

      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      Description of motor controller
    • feed

      public void feed()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Feed the motor safety object.

      Resets the timer on this object that is used to do the timeouts.

    • setExpiration

      public void setExpiration​(double expirationTime)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the expiration time for the corresponding motor safety object.
      Parameters:
      expirationTime - The timeout value in seconds.
    • getExpiration

      public double getExpiration()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Retrieve the timeout value for the corresponding motor safety object.
      Returns:
      the timeout value in seconds.
    • isAlive

      public boolean isAlive()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine of the motor is still operating or has timed out.
      Returns:
      a true value if the motor is still operating normally and hasn't timed out.
    • setSafetyEnabled

      public void setSafetyEnabled​(boolean enabled)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Enable/disable motor safety for this device.

      Turn on and off the motor safety option for this PWM object.

      Parameters:
      enabled - True if motor safety is enforced for this object
    • isSafetyEnabled

      public boolean isSafetyEnabled()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the state of the motor safety enabled flag.

      Return if the motor safety is currently enabled for this device.

      Returns:
      True if motor safety is enforced for this device