CTRE Phoenix 6 C++ 25.0.0-beta-4
|
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along with filtered velocity. More...
#include <ctre/phoenix6/core/CoreCANcoder.hpp>
Public Member Functions | |
constexpr | CANcoderConfiguration ()=default |
constexpr CANcoderConfiguration & | WithMagnetSensor (MagnetSensorConfigs newMagnetSensor) |
Modifies this configuration's MagnetSensor parameter and returns itself for method-chaining and easier to use config API. | |
constexpr CANcoderConfiguration & | WithCustomParams (CustomParamsConfigs newCustomParams) |
Modifies this configuration's CustomParams 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. | |
MagnetSensorConfigs | MagnetSensor |
Configs that affect the magnet sensor and how to interpret it. | |
CustomParamsConfigs | CustomParams |
Custom Params. | |
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along with filtered velocity.
This handles the configurations for the hardware::CANcoder
|
constexprdefault |
|
inlinevirtual |
Take a string and deserialize it to this configuration.
Implements ctre::phoenix6::configs::ParentConfiguration.
|
inlinevirtual |
Get the serialized form of this configuration.
Implements ctre::phoenix6::ISerializable.
|
inlinevirtual |
Get the string representation of this configuration.
Implements ctre::phoenix6::configs::ParentConfiguration.
|
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.
newCustomParams | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's MagnetSensor parameter and returns itself for method-chaining and easier to use config API.
Configs that affect the magnet sensor and how to interpret it.
Includes sensor direction, the sensor discontinuity point, and the magnet offset.
newMagnetSensor | Parameter to modify |
CustomParamsConfigs ctre::phoenix6::configs::CANcoderConfiguration::CustomParams |
Custom Params.
Custom paramaters that have no real impact on controller.
bool ctre::phoenix6::configs::CANcoderConfiguration::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.
MagnetSensorConfigs ctre::phoenix6::configs::CANcoderConfiguration::MagnetSensor |
Configs that affect the magnet sensor and how to interpret it.
Includes sensor direction, the sensor discontinuity point, and the magnet offset.