CTRE Phoenix 6 C++ 25.0.0-beta-4
Loading...
Searching...
No Matches
ctre::phoenix6::configs::TalonFXConfiguration Class Reference

Class description for the Talon FX integrated motor controller. More...

#include <ctre/phoenix6/core/CoreTalonFX.hpp>

Inheritance diagram for ctre::phoenix6::configs::TalonFXConfiguration:
ctre::phoenix6::configs::ParentConfiguration ctre::phoenix6::ISerializable

Public Member Functions

constexpr TalonFXConfiguration ()=default
 
constexpr TalonFXConfigurationWithMotorOutput (MotorOutputConfigs newMotorOutput)
 Modifies this configuration's MotorOutput parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithCurrentLimits (CurrentLimitsConfigs newCurrentLimits)
 Modifies this configuration's CurrentLimits parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithVoltage (VoltageConfigs newVoltage)
 Modifies this configuration's Voltage parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithTorqueCurrent (TorqueCurrentConfigs newTorqueCurrent)
 Modifies this configuration's TorqueCurrent parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithFeedback (FeedbackConfigs newFeedback)
 Modifies this configuration's Feedback parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithDifferentialSensors (DifferentialSensorsConfigs newDifferentialSensors)
 Modifies this configuration's DifferentialSensors parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithDifferentialConstants (DifferentialConstantsConfigs newDifferentialConstants)
 Modifies this configuration's DifferentialConstants parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithOpenLoopRamps (OpenLoopRampsConfigs newOpenLoopRamps)
 Modifies this configuration's OpenLoopRamps parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithClosedLoopRamps (ClosedLoopRampsConfigs newClosedLoopRamps)
 Modifies this configuration's ClosedLoopRamps parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithHardwareLimitSwitch (HardwareLimitSwitchConfigs newHardwareLimitSwitch)
 Modifies this configuration's HardwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithAudio (AudioConfigs newAudio)
 Modifies this configuration's Audio parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithSoftwareLimitSwitch (SoftwareLimitSwitchConfigs newSoftwareLimitSwitch)
 Modifies this configuration's SoftwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithMotionMagic (MotionMagicConfigs newMotionMagic)
 Modifies this configuration's MotionMagic parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithCustomParams (CustomParamsConfigs newCustomParams)
 Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithClosedLoopGeneral (ClosedLoopGeneralConfigs newClosedLoopGeneral)
 Modifies this configuration's ClosedLoopGeneral parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithSlot0 (Slot0Configs newSlot0)
 Modifies this configuration's Slot0 parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithSlot1 (Slot1Configs newSlot1)
 Modifies this configuration's Slot1 parameter and returns itself for method-chaining and easier to use config API.
 
constexpr TalonFXConfigurationWithSlot2 (Slot2Configs newSlot2)
 Modifies this configuration's Slot2 parameter and returns itself for method-chaining and easier to use config API.
 
std::string ToString () const
 Get the string representation of this configuration.
 
std::string Serialize () const
 Get the serialized form of this configuration.
 
ctre::phoenix::StatusCode Deserialize (const std::string &to_deserialize)
 Take a string and deserialize it to this configuration.
 

Public Attributes

bool FutureProofConfigs {true}
 True if we should factory default newer unsupported configs, false to leave newer unsupported configs alone.
 
MotorOutputConfigs MotorOutput
 Configs that directly affect motor output.
 
CurrentLimitsConfigs CurrentLimits
 Configs that directly affect current limiting features.
 
VoltageConfigs Voltage
 Configs that affect Voltage control types.
 
TorqueCurrentConfigs TorqueCurrent
 Configs that affect Torque Current control types.
 
FeedbackConfigs Feedback
 Configs that affect the feedback of this motor controller.
 
DifferentialSensorsConfigs DifferentialSensors
 Configs related to sensors used for differential control of a mechanism.
 
DifferentialConstantsConfigs DifferentialConstants
 Configs related to constants used for differential control of a mechanism.
 
OpenLoopRampsConfigs OpenLoopRamps
 Configs that affect the open-loop control of this motor controller.
 
ClosedLoopRampsConfigs ClosedLoopRamps
 Configs that affect the closed-loop control of this motor controller.
 
HardwareLimitSwitchConfigs HardwareLimitSwitch
 Configs that change how the motor controller behaves under different limit switch states.
 
AudioConfigs Audio
 Configs that affect audible components of the device.
 
SoftwareLimitSwitchConfigs SoftwareLimitSwitch
 Configs that affect how software-limit switches behave.
 
MotionMagicConfigs MotionMagic
 Configs for Motion Magic®.
 
CustomParamsConfigs CustomParams
 Custom Params.
 
ClosedLoopGeneralConfigs ClosedLoopGeneral
 Configs that affect general behavior during closed-looping.
 
Slot0Configs Slot0
 Gains for the specified slot.
 
Slot1Configs Slot1
 Gains for the specified slot.
 
Slot2Configs Slot2
 Gains for the specified slot.
 

Detailed Description

Class description for the Talon FX integrated motor controller.

This handles the configurations for the hardware::TalonFX

Constructor & Destructor Documentation

◆ TalonFXConfiguration()

constexpr ctre::phoenix6::configs::TalonFXConfiguration::TalonFXConfiguration ( )
constexprdefault

Member Function Documentation

◆ Deserialize()

ctre::phoenix::StatusCode ctre::phoenix6::configs::TalonFXConfiguration::Deserialize ( const std::string & to_deserialize)
inlinevirtual

Take a string and deserialize it to this configuration.

Implements ctre::phoenix6::configs::ParentConfiguration.

◆ Serialize()

std::string ctre::phoenix6::configs::TalonFXConfiguration::Serialize ( ) const
inlinevirtual

Get the serialized form of this configuration.

Implements ctre::phoenix6::ISerializable.

◆ ToString()

std::string ctre::phoenix6::configs::TalonFXConfiguration::ToString ( ) const
inlinevirtual

Get the string representation of this configuration.

Implements ctre::phoenix6::configs::ParentConfiguration.

◆ WithAudio()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithAudio ( AudioConfigs newAudio)
inlineconstexpr

Modifies this configuration's Audio parameter and returns itself for method-chaining and easier to use config API.

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

Parameters
newAudioParameter to modify
Returns
Itself

◆ WithClosedLoopGeneral()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithClosedLoopGeneral ( ClosedLoopGeneralConfigs newClosedLoopGeneral)
inlineconstexpr

Modifies this configuration's ClosedLoopGeneral parameter and returns itself for method-chaining and easier to use config API.

Configs that affect general behavior during closed-looping.

Includes Continuous Wrap features.

Parameters
newClosedLoopGeneralParameter to modify
Returns
Itself

◆ WithClosedLoopRamps()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithClosedLoopRamps ( ClosedLoopRampsConfigs newClosedLoopRamps)
inlineconstexpr

Modifies this configuration's ClosedLoopRamps parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the closed-loop control of this motor controller.

Closed-loop ramp rates for the various control types.

Parameters
newClosedLoopRampsParameter to modify
Returns
Itself

◆ WithCurrentLimits()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithCurrentLimits ( CurrentLimitsConfigs newCurrentLimits)
inlineconstexpr

Modifies this configuration's CurrentLimits parameter and returns itself for method-chaining and easier to use config API.

Configs that directly affect current limiting features.

Contains the supply/stator current limit thresholds and whether to enable them.

Parameters
newCurrentLimitsParameter to modify
Returns
Itself

◆ WithCustomParams()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithCustomParams ( CustomParamsConfigs newCustomParams)
inlineconstexpr

Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.

Custom Params.

Custom paramaters that have no real impact on controller.

Parameters
newCustomParamsParameter to modify
Returns
Itself

◆ WithDifferentialConstants()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithDifferentialConstants ( DifferentialConstantsConfigs newDifferentialConstants)
inlineconstexpr

Modifies this configuration's DifferentialConstants parameter and returns itself for method-chaining and easier to use config API.

Configs related to constants used for differential control of a mechanism.

Includes the differential peak outputs.

Parameters
newDifferentialConstantsParameter to modify
Returns
Itself

◆ WithDifferentialSensors()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithDifferentialSensors ( DifferentialSensorsConfigs newDifferentialSensors)
inlineconstexpr

Modifies this configuration's DifferentialSensors parameter and returns itself for method-chaining and easier to use config API.

Configs related to sensors used for differential control of a mechanism.

Includes the differential sensor sources and IDs.

Parameters
newDifferentialSensorsParameter to modify
Returns
Itself

◆ WithFeedback()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithFeedback ( FeedbackConfigs newFeedback)
inlineconstexpr

Modifies this configuration's Feedback parameter and returns itself for method-chaining and easier to use config API.

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.

Parameters
newFeedbackParameter to modify
Returns
Itself

◆ WithHardwareLimitSwitch()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithHardwareLimitSwitch ( HardwareLimitSwitchConfigs newHardwareLimitSwitch)
inlineconstexpr

Modifies this configuration's HardwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.

Configs that change how the motor controller behaves under different limit switch states.

Includes configs such as enabling limit switches, configuring the remote sensor ID, the source, and the position to set on limit.

Parameters
newHardwareLimitSwitchParameter to modify
Returns
Itself

◆ WithMotionMagic()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithMotionMagic ( MotionMagicConfigs newMotionMagic)
inlineconstexpr

Modifies this configuration's MotionMagic parameter and returns itself for method-chaining and easier to use config API.

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

Parameters
newMotionMagicParameter to modify
Returns
Itself

◆ WithMotorOutput()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithMotorOutput ( MotorOutputConfigs newMotorOutput)
inlineconstexpr

Modifies this configuration's MotorOutput parameter and returns itself for method-chaining and easier to use config API.

Configs that directly affect motor output.

Includes motor invert, neutral mode, and other features related to motor output.

Parameters
newMotorOutputParameter to modify
Returns
Itself

◆ WithOpenLoopRamps()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithOpenLoopRamps ( OpenLoopRampsConfigs newOpenLoopRamps)
inlineconstexpr

Modifies this configuration's OpenLoopRamps parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the open-loop control of this motor controller.

Open-loop ramp rates for the various control types.

Parameters
newOpenLoopRampsParameter to modify
Returns
Itself

◆ WithSlot0()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithSlot0 ( Slot0Configs newSlot0)
inlineconstexpr

Modifies this configuration's Slot0 parameter and returns itself for method-chaining and easier to use config API.

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameters
newSlot0Parameter to modify
Returns
Itself

◆ WithSlot1()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithSlot1 ( Slot1Configs newSlot1)
inlineconstexpr

Modifies this configuration's Slot1 parameter and returns itself for method-chaining and easier to use config API.

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameters
newSlot1Parameter to modify
Returns
Itself

◆ WithSlot2()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithSlot2 ( Slot2Configs newSlot2)
inlineconstexpr

Modifies this configuration's Slot2 parameter and returns itself for method-chaining and easier to use config API.

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameters
newSlot2Parameter to modify
Returns
Itself

◆ WithSoftwareLimitSwitch()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithSoftwareLimitSwitch ( SoftwareLimitSwitchConfigs newSoftwareLimitSwitch)
inlineconstexpr

Modifies this configuration's SoftwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.

Configs that affect how software-limit switches behave.

Includes enabling software-limit switches and the threshold at which they are tripped.

Parameters
newSoftwareLimitSwitchParameter to modify
Returns
Itself

◆ WithTorqueCurrent()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithTorqueCurrent ( TorqueCurrentConfigs newTorqueCurrent)
inlineconstexpr

Modifies this configuration's TorqueCurrent parameter and returns itself for method-chaining and easier to use config API.

Configs that affect Torque Current control types.

Includes the maximum and minimum applied torque output and the neutral deadband used during TorqueCurrentFOC requests.

Parameters
newTorqueCurrentParameter to modify
Returns
Itself

◆ WithVoltage()

constexpr TalonFXConfiguration & ctre::phoenix6::configs::TalonFXConfiguration::WithVoltage ( VoltageConfigs newVoltage)
inlineconstexpr

Modifies this configuration's Voltage parameter and returns itself for method-chaining and easier to use config API.

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.

Parameters
newVoltageParameter to modify
Returns
Itself

Member Data Documentation

◆ Audio

AudioConfigs ctre::phoenix6::configs::TalonFXConfiguration::Audio

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

◆ ClosedLoopGeneral

ClosedLoopGeneralConfigs ctre::phoenix6::configs::TalonFXConfiguration::ClosedLoopGeneral

Configs that affect general behavior during closed-looping.

Includes Continuous Wrap features.

◆ ClosedLoopRamps

ClosedLoopRampsConfigs ctre::phoenix6::configs::TalonFXConfiguration::ClosedLoopRamps

Configs that affect the closed-loop control of this motor controller.

Closed-loop ramp rates for the various control types.

◆ CurrentLimits

CurrentLimitsConfigs ctre::phoenix6::configs::TalonFXConfiguration::CurrentLimits

Configs that directly affect current limiting features.

Contains the supply/stator current limit thresholds and whether to enable them.

◆ CustomParams

CustomParamsConfigs ctre::phoenix6::configs::TalonFXConfiguration::CustomParams

Custom Params.

Custom paramaters that have no real impact on controller.

◆ DifferentialConstants

DifferentialConstantsConfigs ctre::phoenix6::configs::TalonFXConfiguration::DifferentialConstants

Configs related to constants used for differential control of a mechanism.

Includes the differential peak outputs.

◆ DifferentialSensors

DifferentialSensorsConfigs ctre::phoenix6::configs::TalonFXConfiguration::DifferentialSensors

Configs related to sensors used for differential control of a mechanism.

Includes the differential sensor sources and IDs.

◆ Feedback

FeedbackConfigs ctre::phoenix6::configs::TalonFXConfiguration::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.

◆ FutureProofConfigs

bool ctre::phoenix6::configs::TalonFXConfiguration::FutureProofConfigs {true}

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.

◆ HardwareLimitSwitch

HardwareLimitSwitchConfigs ctre::phoenix6::configs::TalonFXConfiguration::HardwareLimitSwitch

Configs that change how the motor controller behaves under different limit switch states.

Includes configs such as enabling limit switches, configuring the remote sensor ID, the source, and the position to set on limit.

◆ MotionMagic

MotionMagicConfigs ctre::phoenix6::configs::TalonFXConfiguration::MotionMagic

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

◆ MotorOutput

MotorOutputConfigs ctre::phoenix6::configs::TalonFXConfiguration::MotorOutput

Configs that directly affect motor output.

Includes motor invert, neutral mode, and other features related to motor output.

◆ OpenLoopRamps

OpenLoopRampsConfigs ctre::phoenix6::configs::TalonFXConfiguration::OpenLoopRamps

Configs that affect the open-loop control of this motor controller.

Open-loop ramp rates for the various control types.

◆ Slot0

Slot0Configs ctre::phoenix6::configs::TalonFXConfiguration::Slot0

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

◆ Slot1

Slot1Configs ctre::phoenix6::configs::TalonFXConfiguration::Slot1

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

◆ Slot2

Slot2Configs ctre::phoenix6::configs::TalonFXConfiguration::Slot2

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

◆ SoftwareLimitSwitch

SoftwareLimitSwitchConfigs ctre::phoenix6::configs::TalonFXConfiguration::SoftwareLimitSwitch

Configs that affect how software-limit switches behave.

Includes enabling software-limit switches and the threshold at which they are tripped.

◆ TorqueCurrent

TorqueCurrentConfigs ctre::phoenix6::configs::TalonFXConfiguration::TorqueCurrent

Configs that affect Torque Current control types.

Includes the maximum and minimum applied torque output and the neutral deadband used during TorqueCurrentFOC requests.

◆ Voltage

VoltageConfigs ctre::phoenix6::configs::TalonFXConfiguration::Voltage

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.


The documentation for this class was generated from the following file: