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

Configs that affect how software-limit switches behave. More...

#include <ctre/phoenix6/configs/Configs.hpp>

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

Public Member Functions

constexpr SoftwareLimitSwitchConfigs ()=default
 
constexpr SoftwareLimitSwitchConfigsWithForwardSoftLimitEnable (bool newForwardSoftLimitEnable)
 Modifies this configuration's ForwardSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.
 
constexpr SoftwareLimitSwitchConfigsWithReverseSoftLimitEnable (bool newReverseSoftLimitEnable)
 Modifies this configuration's ReverseSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.
 
constexpr SoftwareLimitSwitchConfigsWithForwardSoftLimitThreshold (units::angle::turn_t newForwardSoftLimitThreshold)
 Modifies this configuration's ForwardSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.
 
constexpr SoftwareLimitSwitchConfigsWithReverseSoftLimitThreshold (units::angle::turn_t newReverseSoftLimitThreshold)
 Modifies this configuration's ReverseSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.
 
std::string ToString () const override
 
std::string Serialize () const override
 
ctre::phoenix::StatusCode Deserialize (const std::string &to_deserialize) override
 

Public Attributes

bool ForwardSoftLimitEnable = false
 If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.
 
bool ReverseSoftLimitEnable = false
 If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.
 
units::angle::turn_t ForwardSoftLimitThreshold = 0_tr
 Position threshold for forward soft limit features.
 
units::angle::turn_t ReverseSoftLimitThreshold = 0_tr
 Position threshold for reverse soft limit features.
 

Detailed Description

Configs that affect how software-limit switches behave.

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

Constructor & Destructor Documentation

◆ SoftwareLimitSwitchConfigs()

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

Member Function Documentation

◆ Deserialize()

ctre::phoenix::StatusCode ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::Deserialize ( const std::string & to_deserialize)
inlineoverridevirtual

◆ Serialize()

std::string ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::Serialize ( ) const
inlineoverridevirtual

◆ ToString()

std::string ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::ToString ( ) const
inlineoverridevirtual

◆ WithForwardSoftLimitEnable()

constexpr SoftwareLimitSwitchConfigs & ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::WithForwardSoftLimitEnable ( bool newForwardSoftLimitEnable)
inlineconstexpr

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

If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.

  • Default Value: False
Parameters
newForwardSoftLimitEnableParameter to modify
Returns
Itself

◆ WithForwardSoftLimitThreshold()

constexpr SoftwareLimitSwitchConfigs & ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::WithForwardSoftLimitThreshold ( units::angle::turn_t newForwardSoftLimitThreshold)
inlineconstexpr

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

Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value: -3.4e+38
  • Maximum Value: 3.4e+38
  • Default Value: 0
  • Units: rotations
Parameters
newForwardSoftLimitThresholdParameter to modify
Returns
Itself

◆ WithReverseSoftLimitEnable()

constexpr SoftwareLimitSwitchConfigs & ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::WithReverseSoftLimitEnable ( bool newReverseSoftLimitEnable)
inlineconstexpr

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

If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.

  • Default Value: False
Parameters
newReverseSoftLimitEnableParameter to modify
Returns
Itself

◆ WithReverseSoftLimitThreshold()

constexpr SoftwareLimitSwitchConfigs & ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::WithReverseSoftLimitThreshold ( units::angle::turn_t newReverseSoftLimitThreshold)
inlineconstexpr

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

Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value: -3.4e+38
  • Maximum Value: 3.4e+38
  • Default Value: 0
  • Units: rotations
Parameters
newReverseSoftLimitThresholdParameter to modify
Returns
Itself

Member Data Documentation

◆ ForwardSoftLimitEnable

bool ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::ForwardSoftLimitEnable = false

If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.

  • Default Value: False

◆ ForwardSoftLimitThreshold

units::angle::turn_t ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::ForwardSoftLimitThreshold = 0_tr

Position threshold for forward soft limit features.

ForwardSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value: -3.4e+38
  • Maximum Value: 3.4e+38
  • Default Value: 0
  • Units: rotations

◆ ReverseSoftLimitEnable

bool ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::ReverseSoftLimitEnable = false

If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.

  • Default Value: False

◆ ReverseSoftLimitThreshold

units::angle::turn_t ctre::phoenix6::configs::SoftwareLimitSwitchConfigs::ReverseSoftLimitThreshold = 0_tr

Position threshold for reverse soft limit features.

ReverseSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value: -3.4e+38
  • Maximum Value: 3.4e+38
  • Default Value: 0
  • Units: rotations

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