Class CustomTalonFX

java.lang.Object
com.ctre.phoenix6.jni.CtreJniWrapper
com.ctre.phoenix6.hardware.ParentDevice
com.ctre.phoenix6.hardware.core.CoreTalonFX
com.ctre.phoenix6.hardware.TalonFX
lib.custom.motorcontrollers.CustomTalonFX
All Implemented Interfaces:
com.ctre.phoenix6.hardware.traits.CommonDevice, com.ctre.phoenix6.hardware.traits.CommonTalon, com.ctre.phoenix6.hardware.traits.CommonTalonWithFOC, com.ctre.phoenix6.hardware.traits.HasTalonControls, com.ctre.phoenix6.hardware.traits.HasTalonSignals, com.ctre.phoenix6.hardware.traits.SupportsFOC, com.ctre.phoenix6.hardware.traits.SupportsMusic, edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj.motorcontrol.MotorController, AutoCloseable, SmartMotorController

public class CustomTalonFX extends com.ctre.phoenix6.hardware.TalonFX implements SmartMotorController
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.ctre.phoenix6.hardware.ParentDevice

    com.ctre.phoenix6.hardware.ParentDevice.MapGenerator

    Nested classes/interfaces inherited from interface lib.custom.motorcontrollers.SmartMotorController

    SmartMotorController.SpeedModifiedSmartMotor
  • Field Summary

    Fields inherited from class com.ctre.phoenix6.hardware.TalonFX

    kDefaultSafetyExpiration

    Fields inherited from class com.ctre.phoenix6.hardware.ParentDevice

    _emptyControl, deviceIdentifier
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomTalonFX(int deviceId)
     
    CustomTalonFX(int deviceId, boolean inverted)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
     
    boolean
     
    void
    setInverted(boolean inverted)
     
    void
    setMotorBrake(boolean brake)
    Setting to toggle brake mode on neutral.

    Methods inherited from class com.ctre.phoenix6.hardware.TalonFX

    close, disable, feed, get, getDescription, getExpiration, initSendable, isAlive, isSafetyEnabled, set, setControlPrivate, setExpiration, setNeutralMode, setNeutralMode, setSafetyEnabled, setVoltage, stopMotor

    Methods inherited from class com.ctre.phoenix6.hardware.core.CoreTalonFX

    clearStickyFault_BootDuringEnable, clearStickyFault_BootDuringEnable, clearStickyFault_BridgeBrownout, clearStickyFault_BridgeBrownout, clearStickyFault_DeviceTemp, clearStickyFault_DeviceTemp, clearStickyFault_ForwardHardLimit, clearStickyFault_ForwardHardLimit, clearStickyFault_ForwardSoftLimit, clearStickyFault_ForwardSoftLimit, clearStickyFault_FusedSensorOutOfSync, clearStickyFault_FusedSensorOutOfSync, clearStickyFault_Hardware, clearStickyFault_Hardware, clearStickyFault_MissingDifferentialFX, clearStickyFault_MissingDifferentialFX, clearStickyFault_MissingHardLimitRemote, clearStickyFault_MissingHardLimitRemote, clearStickyFault_MissingSoftLimitRemote, clearStickyFault_MissingSoftLimitRemote, clearStickyFault_OverSupplyV, clearStickyFault_OverSupplyV, clearStickyFault_ProcTemp, clearStickyFault_ProcTemp, clearStickyFault_RemoteSensorDataInvalid, clearStickyFault_RemoteSensorDataInvalid, clearStickyFault_RemoteSensorPosOverflow, clearStickyFault_RemoteSensorPosOverflow, clearStickyFault_RemoteSensorReset, clearStickyFault_RemoteSensorReset, clearStickyFault_ReverseHardLimit, clearStickyFault_ReverseHardLimit, clearStickyFault_ReverseSoftLimit, clearStickyFault_ReverseSoftLimit, clearStickyFault_StaticBrakeDisabled, clearStickyFault_StaticBrakeDisabled, clearStickyFault_StatorCurrLimit, clearStickyFault_StatorCurrLimit, clearStickyFault_SupplyCurrLimit, clearStickyFault_SupplyCurrLimit, clearStickyFault_Undervoltage, clearStickyFault_Undervoltage, clearStickyFault_UnlicensedFeatureInUse, clearStickyFault_UnlicensedFeatureInUse, clearStickyFault_UnstableSupplyV, clearStickyFault_UnstableSupplyV, clearStickyFault_UsingFusedCANcoderWhileUnlicensed, clearStickyFault_UsingFusedCANcoderWhileUnlicensed, clearStickyFaults, clearStickyFaults, getAcceleration, getAcceleration, getAncillaryDeviceTemp, getAncillaryDeviceTemp, getAppliedRotorPolarity, getAppliedRotorPolarity, getBridgeOutput, getBridgeOutput, getClosedLoopDerivativeOutput, getClosedLoopDerivativeOutput, getClosedLoopError, getClosedLoopError, getClosedLoopFeedForward, getClosedLoopFeedForward, getClosedLoopIntegratedOutput, getClosedLoopIntegratedOutput, getClosedLoopOutput, getClosedLoopOutput, getClosedLoopProportionalOutput, getClosedLoopProportionalOutput, getClosedLoopReference, getClosedLoopReference, getClosedLoopReferenceSlope, getClosedLoopReferenceSlope, getClosedLoopSlot, getClosedLoopSlot, getConfigurator, getConnectedMotor, getConnectedMotor, getControlMode, getControlMode, getDeviceEnable, getDeviceEnable, getDeviceTemp, getDeviceTemp, getDifferentialAveragePosition, getDifferentialAveragePosition, getDifferentialAverageVelocity, getDifferentialAverageVelocity, getDifferentialClosedLoopDerivativeOutput, getDifferentialClosedLoopDerivativeOutput, getDifferentialClosedLoopError, getDifferentialClosedLoopError, getDifferentialClosedLoopFeedForward, getDifferentialClosedLoopFeedForward, getDifferentialClosedLoopIntegratedOutput, getDifferentialClosedLoopIntegratedOutput, getDifferentialClosedLoopOutput, getDifferentialClosedLoopOutput, getDifferentialClosedLoopProportionalOutput, getDifferentialClosedLoopProportionalOutput, getDifferentialClosedLoopReference, getDifferentialClosedLoopReference, getDifferentialClosedLoopReferenceSlope, getDifferentialClosedLoopReferenceSlope, getDifferentialClosedLoopSlot, getDifferentialClosedLoopSlot, getDifferentialControlMode, getDifferentialControlMode, getDifferentialDifferencePosition, getDifferentialDifferencePosition, getDifferentialDifferenceVelocity, getDifferentialDifferenceVelocity, getDifferentialOutput, getDifferentialOutput, getDutyCycle, getDutyCycle, getFault_BootDuringEnable, getFault_BootDuringEnable, getFault_BridgeBrownout, getFault_BridgeBrownout, getFault_DeviceTemp, getFault_DeviceTemp, getFault_ForwardHardLimit, getFault_ForwardHardLimit, getFault_ForwardSoftLimit, getFault_ForwardSoftLimit, getFault_FusedSensorOutOfSync, getFault_FusedSensorOutOfSync, getFault_Hardware, getFault_Hardware, getFault_MissingDifferentialFX, getFault_MissingDifferentialFX, getFault_MissingHardLimitRemote, getFault_MissingHardLimitRemote, getFault_MissingSoftLimitRemote, getFault_MissingSoftLimitRemote, getFault_OverSupplyV, getFault_OverSupplyV, getFault_ProcTemp, getFault_ProcTemp, getFault_RemoteSensorDataInvalid, getFault_RemoteSensorDataInvalid, getFault_RemoteSensorPosOverflow, getFault_RemoteSensorPosOverflow, getFault_RemoteSensorReset, getFault_RemoteSensorReset, getFault_ReverseHardLimit, getFault_ReverseHardLimit, getFault_ReverseSoftLimit, getFault_ReverseSoftLimit, getFault_StaticBrakeDisabled, getFault_StaticBrakeDisabled, getFault_StatorCurrLimit, getFault_StatorCurrLimit, getFault_SupplyCurrLimit, getFault_SupplyCurrLimit, getFault_Undervoltage, getFault_Undervoltage, getFault_UnlicensedFeatureInUse, getFault_UnlicensedFeatureInUse, getFault_UnstableSupplyV, getFault_UnstableSupplyV, getFault_UsingFusedCANcoderWhileUnlicensed, getFault_UsingFusedCANcoderWhileUnlicensed, getFaultField, getFaultField, getForwardLimit, getForwardLimit, getIsProLicensed, getIsProLicensed, getMotionMagicAtTarget, getMotionMagicAtTarget, getMotionMagicIsRunning, getMotionMagicIsRunning, getMotorKT, getMotorKT, getMotorKV, getMotorKV, getMotorOutputStatus, getMotorOutputStatus, getMotorStallCurrent, getMotorStallCurrent, getMotorVoltage, getMotorVoltage, getPosition, getPosition, getProcessorTemp, getProcessorTemp, getReverseLimit, getReverseLimit, getRobotEnable, getRobotEnable, getRotorPosition, getRotorPosition, getRotorVelocity, getRotorVelocity, getSimState, getStatorCurrent, getStatorCurrent, getStickyFault_BootDuringEnable, getStickyFault_BootDuringEnable, getStickyFault_BridgeBrownout, getStickyFault_BridgeBrownout, getStickyFault_DeviceTemp, getStickyFault_DeviceTemp, getStickyFault_ForwardHardLimit, getStickyFault_ForwardHardLimit, getStickyFault_ForwardSoftLimit, getStickyFault_ForwardSoftLimit, getStickyFault_FusedSensorOutOfSync, getStickyFault_FusedSensorOutOfSync, getStickyFault_Hardware, getStickyFault_Hardware, getStickyFault_MissingDifferentialFX, getStickyFault_MissingDifferentialFX, getStickyFault_MissingHardLimitRemote, getStickyFault_MissingHardLimitRemote, getStickyFault_MissingSoftLimitRemote, getStickyFault_MissingSoftLimitRemote, getStickyFault_OverSupplyV, getStickyFault_OverSupplyV, getStickyFault_ProcTemp, getStickyFault_ProcTemp, getStickyFault_RemoteSensorDataInvalid, getStickyFault_RemoteSensorDataInvalid, getStickyFault_RemoteSensorPosOverflow, getStickyFault_RemoteSensorPosOverflow, getStickyFault_RemoteSensorReset, getStickyFault_RemoteSensorReset, getStickyFault_ReverseHardLimit, getStickyFault_ReverseHardLimit, getStickyFault_ReverseSoftLimit, getStickyFault_ReverseSoftLimit, getStickyFault_StaticBrakeDisabled, getStickyFault_StaticBrakeDisabled, getStickyFault_StatorCurrLimit, getStickyFault_StatorCurrLimit, getStickyFault_SupplyCurrLimit, getStickyFault_SupplyCurrLimit, getStickyFault_Undervoltage, getStickyFault_Undervoltage, getStickyFault_UnlicensedFeatureInUse, getStickyFault_UnlicensedFeatureInUse, getStickyFault_UnstableSupplyV, getStickyFault_UnstableSupplyV, getStickyFault_UsingFusedCANcoderWhileUnlicensed, getStickyFault_UsingFusedCANcoderWhileUnlicensed, getStickyFaultField, getStickyFaultField, getSupplyCurrent, getSupplyCurrent, getSupplyVoltage, getSupplyVoltage, getTorqueCurrent, getTorqueCurrent, getVelocity, getVelocity, getVersion, getVersion, getVersionBugfix, getVersionBugfix, getVersionBuild, getVersionBuild, getVersionMajor, getVersionMajor, getVersionMinor, getVersionMinor, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setControl, setPosition, setPosition, setPosition, setPosition

    Methods inherited from class com.ctre.phoenix6.hardware.ParentDevice

    getAppliedControl, getDeviceHash, getDeviceID, getNetwork, getResetOccurredChecker, hasResetOccurred, isConnected, isConnected, lookupStatusSignal, lookupStatusSignal, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilizationForAll, optimizeBusUtilizationForAll, optimizeBusUtilizationForAll, resetSignalFrequencies, resetSignalFrequencies, resetSignalFrequenciesForAll

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.ctre.phoenix6.hardware.traits.CommonDevice

    getAppliedControl, getDeviceHash, getDeviceID, getNetwork, getResetOccurredChecker, hasResetOccurred, isConnected, isConnected, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, resetSignalFrequencies, resetSignalFrequencies

    Methods inherited from interface edu.wpi.first.wpilibj.motorcontrol.MotorController

    disable, get, set, setVoltage, setVoltage, stopMotor

    Methods inherited from interface lib.custom.motorcontrollers.SmartMotorController

    withSpeedMultiplier
  • Constructor Details

    • CustomTalonFX

      public CustomTalonFX(int deviceId, boolean inverted)
    • CustomTalonFX

      public CustomTalonFX(int deviceId)
  • Method Details

    • setMotorBrake

      public void setMotorBrake(boolean brake)
      Setting to toggle brake mode on neutral.

      This does not brake the motor. Use .neutralOutput() instead, after .setMotorBrake(true).

      Specified by:
      setMotorBrake in interface SmartMotorController
    • isFwdLimitSwitchPressed

      public boolean isFwdLimitSwitchPressed()
      Specified by:
      isFwdLimitSwitchPressed in interface SmartMotorController
    • isRevLimitSwitchPressed

      public boolean isRevLimitSwitchPressed()
      Specified by:
      isRevLimitSwitchPressed in interface SmartMotorController
    • setInverted

      public void setInverted(boolean inverted)
      Specified by:
      setInverted in interface edu.wpi.first.wpilibj.motorcontrol.MotorController
      Parameters:
      inverted - Whether to invert - true is clockwise positive, false is counterclockwise positive (default).
    • getInverted

      public boolean getInverted()
      Specified by:
      getInverted in interface edu.wpi.first.wpilibj.motorcontrol.MotorController