CTRE Phoenix 6 C++ 25.2.1
|
Configs related to CANdi's quadrature interface using both the S1IN and S2IN inputs. More...
#include <ctre/phoenix6/configs/Configs.hpp>
Public Member Functions | |
constexpr | QuadratureConfigs ()=default |
constexpr QuadratureConfigs & | WithQuadratureEdgesPerRotation (int newQuadratureEdgesPerRotation) |
Modifies this configuration's QuadratureEdgesPerRotation parameter and returns itself for method-chaining and easier to use config API. | |
constexpr QuadratureConfigs & | WithSensorDirection (bool newSensorDirection) |
Modifies this configuration's SensorDirection 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 Member Functions inherited from ctre::phoenix6::configs::ParentConfiguration | |
Public Member Functions inherited from ctre::phoenix6::ISerializable |
Public Attributes | |
int | QuadratureEdgesPerRotation = 4096 |
The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port. | |
bool | SensorDirection = false |
Direction of the quadrature sensor to determine positive rotation. | |
Configs related to CANdi's quadrature interface using both the S1IN and S2IN inputs.
All the configs related to the quadrature interface for CANdi, including encoder edges per revolution and sensor direction.
|
constexprdefault |
|
inlineoverridevirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
inlineoverridevirtual |
Implements ctre::phoenix6::ISerializable.
|
inlineoverridevirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
inlineconstexpr |
Modifies this configuration's QuadratureEdgesPerRotation parameter and returns itself for method-chaining and easier to use config API.
The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.
This is the total number of transitions from high-to-low or low-to-high across both channels per rotation of the sensor. This is also equivalent to the Counts Per Revolution when using 4x decoding.
For example, the SRX Mag Encoder has 4096 edges per rotation, and a US Digital 1024 CPR (Cycles Per Revolution) quadrature encoder has 4096 edges per rotation.
On the Talon FXS, this can be at most 2,000,000,000 / Peak RPM.
newQuadratureEdgesPerRotation | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's SensorDirection parameter and returns itself for method-chaining and easier to use config API.
Direction of the quadrature sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in quadrature position.
newSensorDirection | Parameter to modify |
int ctre::phoenix6::configs::QuadratureConfigs::QuadratureEdgesPerRotation = 4096 |
The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.
This is the total number of transitions from high-to-low or low-to-high across both channels per rotation of the sensor. This is also equivalent to the Counts Per Revolution when using 4x decoding.
For example, the SRX Mag Encoder has 4096 edges per rotation, and a US Digital 1024 CPR (Cycles Per Revolution) quadrature encoder has 4096 edges per rotation.
On the Talon FXS, this can be at most 2,000,000,000 / Peak RPM.
bool ctre::phoenix6::configs::QuadratureConfigs::SensorDirection = false |
Direction of the quadrature sensor to determine positive rotation.
Invert this so that forward motion on the mechanism results in an increase in quadrature position.