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

Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front of the device. More...

#include <ctre/phoenix6/core/CoreCANrange.hpp>

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

Public Member Functions

constexpr CANrangeConfiguration ()=default
 
constexpr CANrangeConfigurationWithCustomParams (CustomParamsConfigs newCustomParams)
 Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.
 
constexpr CANrangeConfigurationWithToFParams (ToFParamsConfigs newToFParams)
 Modifies this configuration's ToFParams parameter and returns itself for method-chaining and easier to use config API.
 
constexpr CANrangeConfigurationWithProximityParams (ProximityParamsConfigs newProximityParams)
 Modifies this configuration's ProximityParams parameter and returns itself for method-chaining and easier to use config API.
 
constexpr CANrangeConfigurationWithFovParams (FovParamsConfigs newFovParams)
 Modifies this configuration's FovParams 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.
 
CustomParamsConfigs CustomParams
 Custom Params.
 
ToFParamsConfigs ToFParams
 Configs that affect the ToF sensor.
 
ProximityParamsConfigs ProximityParams
 Configs that affect the ToF Proximity detection.
 
FovParamsConfigs FovParams
 Configs that affect the ToF Field of View.
 

Detailed Description

Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front of the device.

This handles the configurations for the hardware::CANrange

Constructor & Destructor Documentation

◆ CANrangeConfiguration()

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

Member Function Documentation

◆ Deserialize()

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

Get the serialized form of this configuration.

Implements ctre::phoenix6::ISerializable.

◆ ToString()

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

Get the string representation of this configuration.

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

◆ WithCustomParams()

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

◆ WithFovParams()

constexpr CANrangeConfiguration & ctre::phoenix6::configs::CANrangeConfiguration::WithFovParams ( FovParamsConfigs newFovParams)
inlineconstexpr

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

Configs that affect the ToF Field of View

Includes range and center configs

Parameters
newFovParamsParameter to modify
Returns
Itself

◆ WithProximityParams()

constexpr CANrangeConfiguration & ctre::phoenix6::configs::CANrangeConfiguration::WithProximityParams ( ProximityParamsConfigs newProximityParams)
inlineconstexpr

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

Configs that affect the ToF Proximity detection

Includes proximity mode and the threshold for simple detection

Parameters
newProximityParamsParameter to modify
Returns
Itself

◆ WithToFParams()

constexpr CANrangeConfiguration & ctre::phoenix6::configs::CANrangeConfiguration::WithToFParams ( ToFParamsConfigs newToFParams)
inlineconstexpr

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

Configs that affect the ToF sensor

Includes Update mode and frequency

Parameters
newToFParamsParameter to modify
Returns
Itself

Member Data Documentation

◆ CustomParams

CustomParamsConfigs ctre::phoenix6::configs::CANrangeConfiguration::CustomParams

Custom Params.

Custom paramaters that have no real impact on controller.

◆ FovParams

FovParamsConfigs ctre::phoenix6::configs::CANrangeConfiguration::FovParams

Configs that affect the ToF Field of View.

Includes range and center configs

◆ FutureProofConfigs

bool ctre::phoenix6::configs::CANrangeConfiguration::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.

◆ ProximityParams

ProximityParamsConfigs ctre::phoenix6::configs::CANrangeConfiguration::ProximityParams

Configs that affect the ToF Proximity detection.

Includes proximity mode and the threshold for simple detection

◆ ToFParams

ToFParamsConfigs ctre::phoenix6::configs::CANrangeConfiguration::ToFParams

Configs that affect the ToF sensor.

Includes Update mode and frequency


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