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

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>

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

Public Member Functions

constexpr CANcoderConfiguration ()=default
 
constexpr CANcoderConfigurationWithMagnetSensor (MagnetSensorConfigs newMagnetSensor)
 Modifies this configuration's MagnetSensor parameter and returns itself for method-chaining and easier to use config API.
 
constexpr CANcoderConfigurationWithCustomParams (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.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ CANcoderConfiguration()

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

Member Function Documentation

◆ Deserialize()

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfiguration::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::CANcoderConfiguration::Serialize ( ) const
inlinevirtual

Get the serialized form of this configuration.

Implements ctre::phoenix6::ISerializable.

◆ ToString()

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

Get the string representation of this configuration.

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

◆ WithCustomParams()

constexpr CANcoderConfiguration & ctre::phoenix6::configs::CANcoderConfiguration::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

◆ WithMagnetSensor()

constexpr CANcoderConfiguration & ctre::phoenix6::configs::CANcoderConfiguration::WithMagnetSensor ( MagnetSensorConfigs newMagnetSensor)
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.

Parameters
newMagnetSensorParameter to modify
Returns
Itself

Member Data Documentation

◆ CustomParams

CustomParamsConfigs ctre::phoenix6::configs::CANcoderConfiguration::CustomParams

Custom Params.

Custom paramaters that have no real impact on controller.

◆ FutureProofConfigs

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.

◆ MagnetSensor

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.


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