Class TalonFXConfiguration
- All Implemented Interfaces:
ParentConfiguration
,ISerializable
public class TalonFXConfiguration extends Object implements ParentConfiguration
TalonFX
-
Field Summary
Fields Modifier and Type Field Description AudioConfigs
Audio
Configs that affect audible components of the device.ClosedLoopGeneralConfigs
ClosedLoopGeneral
Configs that affect general behavior during closed-looping.ClosedLoopRampsConfigs
ClosedLoopRamps
Configs that affect the closed-loop control of this motor controller.CurrentLimitsConfigs
CurrentLimits
Configs that directly affect current limiting features.CustomParamsConfigs
CustomParams
Custom Params.DifferentialConstantsConfigs
DifferentialConstants
Configs related to constants used for differential control of a mechanism.DifferentialSensorsConfigs
DifferentialSensors
Configs related to sensors used for differential control of a mechanism.FeedbackConfigs
Feedback
Configs that affect the feedback of this motor controller.boolean
FutureProofConfigs
True if we should factory default newer unsupported configs, false to leave newer unsupported configs alone.HardwareLimitSwitchConfigs
HardwareLimitSwitch
Configs that change how the motor controller behaves under different limit switch statse.MotionMagicConfigs
MotionMagic
Configs for Motion MagicĀ®.MotorOutputConfigs
MotorOutput
Configs that directly affect motor-output.OpenLoopRampsConfigs
OpenLoopRamps
Configs that affect the open-loop control of this motor controller.Slot0Configs
Slot0
Gains for the specified slot.Slot1Configs
Slot1
Gains for the specified slot.Slot2Configs
Slot2
Gains for the specified slot.SoftwareLimitSwitchConfigs
SoftwareLimitSwitch
Configs that affect how software-limit switches behave.TorqueCurrentConfigs
TorqueCurrent
Configs to control the maximum and minimum applied torque when using Torque Current control types.VoltageConfigs
Voltage
Voltage-specific configs -
Constructor Summary
Constructors Constructor Description TalonFXConfiguration()
-
Method Summary
Modifier and Type Method Description StatusCode
deserialize(String to_deserialize)
Take a string and deserialize it to this configurationString
serialize()
Get the serialized form of this configurationString
toString()
TalonFXConfiguration
withAudio(AudioConfigs newAudio)
Modifies this configuration's Audio parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withClosedLoopGeneral(ClosedLoopGeneralConfigs newClosedLoopGeneral)
Modifies this configuration's ClosedLoopGeneral parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withClosedLoopRamps(ClosedLoopRampsConfigs newClosedLoopRamps)
Modifies this configuration's ClosedLoopRamps parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withCurrentLimits(CurrentLimitsConfigs newCurrentLimits)
Modifies this configuration's CurrentLimits parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withCustomParams(CustomParamsConfigs newCustomParams)
Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withDifferentialConstants(DifferentialConstantsConfigs newDifferentialConstants)
Modifies this configuration's DifferentialConstants parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withDifferentialSensors(DifferentialSensorsConfigs newDifferentialSensors)
Modifies this configuration's DifferentialSensors parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withFeedback(FeedbackConfigs newFeedback)
Modifies this configuration's Feedback parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withHardwareLimitSwitch(HardwareLimitSwitchConfigs newHardwareLimitSwitch)
Modifies this configuration's HardwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withMotionMagic(MotionMagicConfigs newMotionMagic)
Modifies this configuration's MotionMagic parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withMotorOutput(MotorOutputConfigs newMotorOutput)
Modifies this configuration's MotorOutput parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withOpenLoopRamps(OpenLoopRampsConfigs newOpenLoopRamps)
Modifies this configuration's OpenLoopRamps parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withSlot0(Slot0Configs newSlot0)
Modifies this configuration's Slot0 parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withSlot1(Slot1Configs newSlot1)
Modifies this configuration's Slot1 parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withSlot2(Slot2Configs newSlot2)
Modifies this configuration's Slot2 parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withSoftwareLimitSwitch(SoftwareLimitSwitchConfigs newSoftwareLimitSwitch)
Modifies this configuration's SoftwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withTorqueCurrent(TorqueCurrentConfigs newTorqueCurrent)
Modifies this configuration's TorqueCurrent parameter and returns itself for method-chaining and easier to use config API.TalonFXConfiguration
withVoltage(VoltageConfigs newVoltage)
Modifies this configuration's Voltage parameter and returns itself for method-chaining and easier to use config API.
-
Field Details
-
FutureProofConfigs
True if we should factory default newer unsupported configs, false to leave newer unsupported configs alone.This flag addresses a corner case where the device may have firmware with newer configs that didn't exist when this version of the API was built. If this occurs and this flag is true, unsupported new configs will be factory defaulted to avoid unexpected behavior.
This is also the behavior in Phoenix 5, so this flag is defaulted to true to match.
-
MotorOutput
Configs that directly affect motor-output.Includes Motor Invert and various limit features.
-
CurrentLimits
Configs that directly affect current limiting features.Contains the supply/stator current limit thresholds and whether to enable them or not.
-
Voltage
Voltage-specific configsVoltage-specific configs
-
TorqueCurrent
Configs to control the maximum and minimum applied torque when using Torque Current control types.Similar to peak output, but for the TorqueCurrentFOC control type requests.
-
Feedback
Configs that affect the feedback of this motor controller.Includes feedback sensor source, any offsets for the feedback sensor, and various ratios to describe the relationship between the sensor and the mechanism for closed looping.
-
DifferentialSensors
Configs related to sensors used for differential control of a mechanism.Includes the differential sensor sources and IDs.
-
DifferentialConstants
Configs related to constants used for differential control of a mechanism.Includes the differential peak outputs.
-
OpenLoopRamps
Configs that affect the open-loop control of this motor controller.Open-loop ramp rates for the various control types.
-
ClosedLoopRamps
Configs that affect the closed-loop control of this motor controller.Closed-loop ramp rates for the various control types.
-
HardwareLimitSwitch
Configs that change how the motor controller behaves under different limit switch statse.Includes configs such as enabling limit switches, configuring the remote sensor ID, the source, and the position to set on limit.
-
Audio
Configs that affect audible components of the device.Includes configuration for the beep on boot.
-
SoftwareLimitSwitch
Configs that affect how software-limit switches behave.Includes enabling software-limit switches and the threshold at which they're tripped.
-
MotionMagic
Configs for Motion MagicĀ®.Includes Velocity, Acceleration, Jerk, and Expo parameters.
-
CustomParams
Custom Params.Custom paramaters that have no real impact on controller.
-
ClosedLoopGeneral
Configs that affect general behavior during closed-looping.Includes Continuous Wrap features.
-
Slot0
Gains for the specified slot.If this slot is selected, these gains are used in closed loop control requests.
-
Slot1
Gains for the specified slot.If this slot is selected, these gains are used in closed loop control requests.
-
Slot2
Gains for the specified slot.If this slot is selected, these gains are used in closed loop control requests.
-
-
Constructor Details
-
TalonFXConfiguration
public TalonFXConfiguration()
-
-
Method Details
-
withMotorOutput
Modifies this configuration's MotorOutput parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newMotorOutput
- Parameter to modify- Returns:
- Itself
-
withCurrentLimits
Modifies this configuration's CurrentLimits parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newCurrentLimits
- Parameter to modify- Returns:
- Itself
-
withVoltage
Modifies this configuration's Voltage parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newVoltage
- Parameter to modify- Returns:
- Itself
-
withTorqueCurrent
Modifies this configuration's TorqueCurrent parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newTorqueCurrent
- Parameter to modify- Returns:
- Itself
-
withFeedback
Modifies this configuration's Feedback parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newFeedback
- Parameter to modify- Returns:
- Itself
-
withDifferentialSensors
public TalonFXConfiguration withDifferentialSensors(DifferentialSensorsConfigs newDifferentialSensors)Modifies this configuration's DifferentialSensors parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newDifferentialSensors
- Parameter to modify- Returns:
- Itself
-
withDifferentialConstants
public TalonFXConfiguration withDifferentialConstants(DifferentialConstantsConfigs newDifferentialConstants)Modifies this configuration's DifferentialConstants parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newDifferentialConstants
- Parameter to modify- Returns:
- Itself
-
withOpenLoopRamps
Modifies this configuration's OpenLoopRamps parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newOpenLoopRamps
- Parameter to modify- Returns:
- Itself
-
withClosedLoopRamps
Modifies this configuration's ClosedLoopRamps parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newClosedLoopRamps
- Parameter to modify- Returns:
- Itself
-
withHardwareLimitSwitch
public TalonFXConfiguration withHardwareLimitSwitch(HardwareLimitSwitchConfigs newHardwareLimitSwitch)Modifies this configuration's HardwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newHardwareLimitSwitch
- Parameter to modify- Returns:
- Itself
-
withAudio
Modifies this configuration's Audio parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newAudio
- Parameter to modify- Returns:
- Itself
-
withSoftwareLimitSwitch
public TalonFXConfiguration withSoftwareLimitSwitch(SoftwareLimitSwitchConfigs newSoftwareLimitSwitch)Modifies this configuration's SoftwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newSoftwareLimitSwitch
- Parameter to modify- Returns:
- Itself
-
withMotionMagic
Modifies this configuration's MotionMagic parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newMotionMagic
- Parameter to modify- Returns:
- Itself
-
withCustomParams
Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newCustomParams
- Parameter to modify- Returns:
- Itself
-
withClosedLoopGeneral
Modifies this configuration's ClosedLoopGeneral parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newClosedLoopGeneral
- Parameter to modify- Returns:
- Itself
-
withSlot0
Modifies this configuration's Slot0 parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newSlot0
- Parameter to modify- Returns:
- Itself
-
withSlot1
Modifies this configuration's Slot1 parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newSlot1
- Parameter to modify- Returns:
- Itself
-
withSlot2
Modifies this configuration's Slot2 parameter and returns itself for method-chaining and easier to use config API.- Parameters:
newSlot2
- Parameter to modify- Returns:
- Itself
-
toString
-
serialize
Get the serialized form of this configuration- Specified by:
serialize
in interfaceISerializable
- Returns:
- Serialized form of this config group
-
deserialize
Take a string and deserialize it to this configuration- Specified by:
deserialize
in interfaceParentConfiguration
- Returns:
- Return code of the deserialize method
-