CTRE Phoenix 6 C++ 24.3.0
|
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 | |
CANcoderConfiguration & | WithMagnetSensor (MagnetSensorConfigs newMagnetSensor) |
Modifies this configuration's MagnetSensor parameter and returns itself for method-chaining and easier to use config API. More... | |
std::string | ToString () const |
Get the string representation of this configuration. More... | |
std::string | Serialize () const |
Get the serialized form of this configuration. More... | |
ctre::phoenix::StatusCode | Deserialize (const std::string &to_deserialize) |
Take a string and deserialize it to this configuration. More... | |
virtual std::string | ToString () const =0 |
virtual ctre::phoenix::StatusCode | Deserialize (const std::string &string)=0 |
virtual std::string | Serialize () const =0 |
Public Attributes | |
bool | FutureProofConfigs {true} |
True if we should factory default newer unsupported configs, false to leave newer unsupported configs alone. More... | |
MagnetSensorConfigs | MagnetSensor |
Configs that affect the magnet sensor and how to interpret it. More... | |
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
|
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.
|
inline |
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 range, sensor direction, and the magnet offset.
newMagnetSensor | Parameter to modify |
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 range, sensor direction, and the magnet offset.