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

Configs that affect the ToF Proximity detection. More...

#include <ctre/phoenix6/configs/Configs.hpp>

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

Public Member Functions

constexpr ProximityParamsConfigs ()=default
 
constexpr ProximityParamsConfigsWithProximityThreshold (units::length::meter_t newProximityThreshold)
 Modifies this configuration's ProximityThreshold parameter and returns itself for method-chaining and easier to use config API.
 
constexpr ProximityParamsConfigsWithProximityHysteresis (units::length::meter_t newProximityHysteresis)
 Modifies this configuration's ProximityHysteresis parameter and returns itself for method-chaining and easier to use config API.
 
constexpr ProximityParamsConfigsWithMinSignalStrengthForValidMeasurement (units::dimensionless::scalar_t newMinSignalStrengthForValidMeasurement)
 Modifies this configuration's MinSignalStrengthForValidMeasurement 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 Attributes

units::length::meter_t ProximityThreshold = 0.4_m
 Threshold for object detection.
 
units::length::meter_t ProximityHysteresis = 0.01_m
 How far above and below the threshold the distance needs to be to trigger undetected and detected, respectively.
 
units::dimensionless::scalar_t MinSignalStrengthForValidMeasurement = 2500
 The minimum allowable signal strength before determining the measurement is valid.
 

Detailed Description

Configs that affect the ToF Proximity detection.

Includes proximity mode and the threshold for simple detection

Constructor & Destructor Documentation

◆ ProximityParamsConfigs()

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

Member Function Documentation

◆ Deserialize()

ctre::phoenix::StatusCode ctre::phoenix6::configs::ProximityParamsConfigs::Deserialize ( const std::string & to_deserialize)
inlineoverridevirtual

◆ Serialize()

std::string ctre::phoenix6::configs::ProximityParamsConfigs::Serialize ( ) const
inlineoverridevirtual

◆ ToString()

std::string ctre::phoenix6::configs::ProximityParamsConfigs::ToString ( ) const
inlineoverridevirtual

◆ WithMinSignalStrengthForValidMeasurement()

constexpr ProximityParamsConfigs & ctre::phoenix6::configs::ProximityParamsConfigs::WithMinSignalStrengthForValidMeasurement ( units::dimensionless::scalar_t newMinSignalStrengthForValidMeasurement)
inlineconstexpr

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

The minimum allowable signal strength before determining the measurement is valid.

If the signal strength is particularly low, this typically means the object is far away and there's fewer total samples to derive the distance from. Set this value to be below the lowest strength you see when you're detecting an object with the CANrange; the default of 2500 is typically acceptable in most cases.

  • Minimum Value: 1
  • Maximum Value: 15000
  • Default Value: 2500
  • Units:
Parameters
newMinSignalStrengthForValidMeasurementParameter to modify
Returns
Itself

◆ WithProximityHysteresis()

constexpr ProximityParamsConfigs & ctre::phoenix6::configs::ProximityParamsConfigs::WithProximityHysteresis ( units::length::meter_t newProximityHysteresis)
inlineconstexpr

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

How far above and below the threshold the distance needs to be to trigger undetected and detected, respectively. This is used to prevent bouncing between the detected and undetected states for objects on the threshold.

If the threshold is set to 0.1 meters, and the hysteresis is 0.01 meters, then an object needs to be within 0.09 meters to be detected. After the object is first detected, the distance then needs to exceed 0.11 meters to become undetected again.

  • Minimum Value: 0
  • Maximum Value: 1
  • Default Value: 0.01
  • Units: m
Parameters
newProximityHysteresisParameter to modify
Returns
Itself

◆ WithProximityThreshold()

constexpr ProximityParamsConfigs & ctre::phoenix6::configs::ProximityParamsConfigs::WithProximityThreshold ( units::length::meter_t newProximityThreshold)
inlineconstexpr

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

Threshold for object detection.

  • Minimum Value: 0
  • Maximum Value: 4
  • Default Value: 0.4
  • Units: m
Parameters
newProximityThresholdParameter to modify
Returns
Itself

Member Data Documentation

◆ MinSignalStrengthForValidMeasurement

units::dimensionless::scalar_t ctre::phoenix6::configs::ProximityParamsConfigs::MinSignalStrengthForValidMeasurement = 2500

The minimum allowable signal strength before determining the measurement is valid.

If the signal strength is particularly low, this typically means the object is far away and there's fewer total samples to derive the distance from. Set this value to be below the lowest strength you see when you're detecting an object with the CANrange; the default of 2500 is typically acceptable in most cases.

  • Minimum Value: 1
  • Maximum Value: 15000
  • Default Value: 2500
  • Units:

◆ ProximityHysteresis

units::length::meter_t ctre::phoenix6::configs::ProximityParamsConfigs::ProximityHysteresis = 0.01_m

How far above and below the threshold the distance needs to be to trigger undetected and detected, respectively.

This is used to prevent bouncing between the detected and undetected states for objects on the threshold.

If the threshold is set to 0.1 meters, and the hysteresis is 0.01 meters, then an object needs to be within 0.09 meters to be detected. After the object is first detected, the distance then needs to exceed 0.11 meters to become undetected again.

  • Minimum Value: 0
  • Maximum Value: 1
  • Default Value: 0.01
  • Units: m

◆ ProximityThreshold

units::length::meter_t ctre::phoenix6::configs::ProximityParamsConfigs::ProximityThreshold = 0.4_m

Threshold for object detection.

  • Minimum Value: 0
  • Maximum Value: 4
  • Default Value: 0.4
  • Units: m

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