|
CTRE Phoenix 6 C++ 26.70.0-alpha-2
|
Configs that affect the ToF Proximity detection. More...
#include <ctre/phoenix6/configs/ProximityParamsConfigs.hpp>
Public Member Functions | |
| constexpr | ProximityParamsConfigs ()=default |
| constexpr ProximityParamsConfigs & | WithProximityThreshold (wpi::units::meter_t newProximityThreshold) |
| Modifies this configuration's ProximityThreshold parameter and returns itself for method-chaining and easier to use config API. | |
| constexpr ProximityParamsConfigs & | WithProximityHysteresis (wpi::units::meter_t newProximityHysteresis) |
| Modifies this configuration's ProximityHysteresis parameter and returns itself for method-chaining and easier to use config API. | |
| constexpr ProximityParamsConfigs & | WithMinSignalStrengthForValidMeasurement (wpi::units::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 final |
| Serialize this configuration into a string. | |
| ctre::phoenix::StatusCode | Deserialize (std::string const &to_deserialize) final |
| Deserialize this configuration from a string. | |
Public Attributes | |
| wpi::units::meter_t | ProximityThreshold = 0.4_m |
| Threshold for object detection. | |
| wpi::units::meter_t | ProximityHysteresis = 0.01_m |
| How far above and below the threshold the distance needs to be to trigger undetected and detected, respectively. | |
| wpi::units::scalar_t | MinSignalStrengthForValidMeasurement = 2500 |
| The minimum allowable signal strength before determining the measurement is valid. | |
Configs that affect the ToF Proximity detection.
Includes proximity mode and the threshold for simple detection
|
constexprdefault |
|
finalvirtual |
Deserialize this configuration from a string.
| string | The serialized configuration |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
finalvirtual |
Serialize this configuration into a string.
Implements ctre::phoenix6::configs::ParentConfiguration.
|
overridevirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
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.
| newMinSignalStrengthForValidMeasurement | Parameter to modify |
|
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.
| newProximityHysteresis | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's ProximityThreshold parameter and returns itself for method-chaining and easier to use config API.
Threshold for object detection.
| newProximityThreshold | Parameter to modify |
| wpi::units::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.
| wpi::units::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.
| wpi::units::meter_t ctre::phoenix6::configs::ProximityParamsConfigs::ProximityThreshold = 0.4_m |
Threshold for object detection.