16#include <units/angle.h>
17#include <units/dimensionless.h>
18#include <units/length.h>
19#include <units/time.h>
20#include <units/voltage.h>
163 std::stringstream ss;
164 ss <<
"CANrangeConfiguration" << std::endl;
177 std::stringstream ss;
557 std::stringstream ss;
594 std::stringstream ss;
633 std::stringstream ss;
672 std::stringstream ss;
711 std::stringstream ss;
785 std::unique_ptr<sim::CANrangeSimState> _simState{};
798 if (_simState ==
nullptr)
799 _simState = std::make_unique<sim::CANrangeSimState>(*
this);
ii that the Software will be uninterrupted or error free
Definition CTRE_LICENSE.txt:226
CTREXPORT int c_ctre_phoenix6_serialize_double(int spn, double value, char **str)
Class for getting information about an available CAN bus.
Definition CANBus.hpp:19
Represents a status signal with data of type T, and operations available to retrieve information abou...
Definition StatusSignal.hpp:657
Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CoreCANrange.hpp:40
ToFParamsConfigs ToFParams
Configs that affect the ToF sensor.
Definition CoreCANrange.hpp:72
constexpr CANrangeConfiguration & WithFovParams(FovParamsConfigs newFovParams)
Modifies this configuration's FovParams parameter and returns itself for method-chaining and easier t...
Definition CoreCANrange.hpp:152
bool FutureProofConfigs
True if we should factory default newer unsupported configs, false to leave newer unsupported configs...
Definition CoreCANrange.hpp:57
ProximityParamsConfigs ProximityParams
Configs that affect the ToF Proximity detection.
Definition CoreCANrange.hpp:80
ctre::phoenix::StatusCode Deserialize(const std::string &to_deserialize)
Take a string and deserialize it to this configuration.
Definition CoreCANrange.hpp:188
std::string ToString() const
Get the string representation of this configuration.
Definition CoreCANrange.hpp:161
constexpr CANrangeConfiguration()=default
FovParamsConfigs FovParams
Configs that affect the ToF Field of View.
Definition CoreCANrange.hpp:87
CustomParamsConfigs CustomParams
Custom Params.
Definition CoreCANrange.hpp:65
constexpr CANrangeConfiguration & WithCustomParams(CustomParamsConfigs newCustomParams)
Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easie...
Definition CoreCANrange.hpp:100
constexpr CANrangeConfiguration & WithToFParams(ToFParamsConfigs newToFParams)
Modifies this configuration's ToFParams parameter and returns itself for method-chaining and easier t...
Definition CoreCANrange.hpp:117
constexpr CANrangeConfiguration & WithProximityParams(ProximityParamsConfigs newProximityParams)
Modifies this configuration's ProximityParams parameter and returns itself for method-chaining and ea...
Definition CoreCANrange.hpp:135
std::string Serialize() const
Get the serialized form of this configuration.
Definition CoreCANrange.hpp:175
Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CoreCANrange.hpp:206
ctre::phoenix::StatusCode Apply(const CustomParamsConfigs &configs)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:318
ctre::phoenix::StatusCode Apply(const ToFParamsConfigs &configs)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:378
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition CoreCANrange.hpp:535
ctre::phoenix::StatusCode Apply(const CustomParamsConfigs &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:332
ctre::phoenix::StatusCode Refresh(ToFParamsConfigs &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:360
ctre::phoenix::StatusCode Refresh(FovParamsConfigs &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:480
ctre::phoenix::StatusCode Apply(const CANrangeConfiguration &configs)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:257
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(units::time::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CoreCANrange.hpp:631
ctre::phoenix::StatusCode ClearStickyFault_Hardware()
Clear sticky fault: Hardware fault occurred.
Definition CoreCANrange.hpp:576
ctre::phoenix::StatusCode Refresh(CustomParamsConfigs &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:300
ctre::phoenix::StatusCode Refresh(CANrangeConfiguration &configs) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:225
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse(units::time::second_t timeoutSeconds)
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CoreCANrange.hpp:709
ctre::phoenix::StatusCode Refresh(CANrangeConfiguration &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:239
ctre::phoenix::StatusCode Apply(const FovParamsConfigs &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:512
ctre::phoenix::StatusCode Apply(const CANrangeConfiguration &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:271
ctre::phoenix::StatusCode Apply(const ToFParamsConfigs &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:392
ctre::phoenix::StatusCode Apply(const ProximityParamsConfigs &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:452
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable()
Clear sticky fault: Device boot while detecting the enable signal.
Definition CoreCANrange.hpp:653
ctre::phoenix::StatusCode Refresh(ProximityParamsConfigs &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:420
ctre::phoenix::StatusCode ClearStickyFault_Hardware(units::time::second_t timeoutSeconds)
Clear sticky fault: Hardware fault occurred.
Definition CoreCANrange.hpp:592
ctre::phoenix::StatusCode Refresh(ToFParamsConfigs &configs) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:347
ctre::phoenix::StatusCode Refresh(FovParamsConfigs &configs) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:467
ctre::phoenix::StatusCode Refresh(CustomParamsConfigs &configs) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:287
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse()
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CoreCANrange.hpp:692
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable(units::time::second_t timeoutSeconds)
Clear sticky fault: Device boot while detecting the enable signal.
Definition CoreCANrange.hpp:670
ctre::phoenix::StatusCode Apply(const FovParamsConfigs &configs)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:498
ctre::phoenix::StatusCode ClearStickyFaults(units::time::second_t timeoutSeconds)
Clear the sticky faults in the device.
Definition CoreCANrange.hpp:555
ctre::phoenix::StatusCode Refresh(ProximityParamsConfigs &configs) const
Refreshes the values of the specified config group.
Definition CoreCANrange.hpp:407
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage()
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CoreCANrange.hpp:614
ctre::phoenix::StatusCode Apply(const ProximityParamsConfigs &configs)
Applies the contents of the specified config to the device.
Definition CoreCANrange.hpp:438
Custom Params.
Definition Configs.hpp:3640
std::string ToString() const override
Definition Configs.hpp:3709
std::string Serialize() const override
Definition Configs.hpp:3718
ctre::phoenix::StatusCode Deserialize(const std::string &to_deserialize) override
Definition Configs.hpp:3727
Configs that affect the ToF Field of View.
Definition Configs.hpp:4066
std::string ToString() const override
Definition Configs.hpp:4229
ctre::phoenix::StatusCode Deserialize(const std::string &to_deserialize) override
Definition Configs.hpp:4251
std::string Serialize() const override
Definition Configs.hpp:4240
Definition Configs.hpp:38
Definition Configurator.hpp:22
ctre::phoenix::StatusCode SetConfigsPrivate(const std::string &serializedString, units::time::second_t timeoutSeconds, bool futureProofConfigs, bool overrideIfDuplicate)
Definition Configurator.hpp:77
ctre::phoenix::StatusCode GetConfigsPrivate(std::string &serializedString, units::time::second_t timeoutSeconds) const
Definition Configurator.hpp:101
units::time::second_t DefaultTimeoutSeconds
The default maximum amount of time to wait for a config.
Definition Configurator.hpp:27
Configs that affect the ToF Proximity detection.
Definition Configs.hpp:3898
std::string ToString() const override
Definition Configs.hpp:4022
std::string Serialize() const override
Definition Configs.hpp:4032
ctre::phoenix::StatusCode Deserialize(const std::string &to_deserialize) override
Definition Configs.hpp:4042
Configs that affect the ToF sensor.
Definition Configs.hpp:3797
std::string Serialize() const override
Definition Configs.hpp:3869
std::string ToString() const override
Definition Configs.hpp:3860
ctre::phoenix::StatusCode Deserialize(const std::string &to_deserialize) override
Definition Configs.hpp:3878
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:29
Definition DeviceIdentifier.hpp:19
Parent class for all devices.
Definition ParentDevice.hpp:29
Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CoreCANrange.hpp:728
StatusSignal< bool > & GetStickyFault_Undervoltage(bool refresh=true)
Device supply voltage dropped to near brownout levels.
StatusSignal< int > & GetVersionMajor(bool refresh=true)
App Major Version number.
StatusSignal< units::dimensionless::scalar_t > & GetSignalStrength(bool refresh=true)
Approximate signal strength of the measurement.
StatusSignal< units::time::second_t > & GetMeasurementTime(bool refresh=true)
Timestamp of the most recent measurements.
CoreCANrange(int deviceId, std::string canbus="")
Constructs a new CANrange object.
StatusSignal< bool > & GetFault_Undervoltage(bool refresh=true)
Device supply voltage dropped to near brownout levels.
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(units::time::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CoreCANrange.hpp:1395
StatusSignal< int > & GetVersionBuild(bool refresh=true)
App Build Version number.
ctre::phoenix::StatusCode SetControl(const controls::ControlRequest &request)
Control device with generic control request object.
Definition CoreCANrange.hpp:1327
StatusSignal< bool > & GetFault_UnlicensedFeatureInUse(bool refresh=true)
An unlicensed feature is in use, device may not behave as expected.
StatusSignal< units::angle::degree_t > & GetRealFOVRangeY(bool refresh=true)
The actual range of the FOV in the Y direction.
StatusSignal< bool > & GetFault_BootDuringEnable(bool refresh=true)
Device boot while detecting the enable signal.
ctre::phoenix::StatusCode ClearStickyFault_Hardware(units::time::second_t timeoutSeconds)
Clear sticky fault: Hardware fault occurred.
Definition CoreCANrange.hpp:1372
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable(units::time::second_t timeoutSeconds)
Clear sticky fault: Device boot while detecting the enable signal.
Definition CoreCANrange.hpp:1419
sim::CANrangeSimState & GetSimState()
Get the simulation state for this device.
Definition CoreCANrange.hpp:796
StatusSignal< bool > & GetFault_Hardware(bool refresh=true)
Hardware fault occurred.
StatusSignal< bool > & GetStickyFault_UnlicensedFeatureInUse(bool refresh=true)
An unlicensed feature is in use, device may not behave as expected.
StatusSignal< int > & GetVersionBugfix(bool refresh=true)
App Bugfix Version number.
ctre::phoenix::StatusCode ClearStickyFaults(units::time::second_t timeoutSeconds)
Clear the sticky faults in the device.
Definition CoreCANrange.hpp:1346
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse()
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CoreCANrange.hpp:1455
StatusSignal< bool > & GetIsDetected(bool refresh=true)
Whether the CANrange detects an object using the configured proximity parameters.
StatusSignal< units::angle::degree_t > & GetRealFOVCenterY(bool refresh=true)
The actual center of the FOV in the Y direction.
StatusSignal< int > & GetFaultField(bool refresh=true)
Integer representing all fault flags reported by the device.
StatusSignal< bool > & GetStickyFault_Hardware(bool refresh=true)
Hardware fault occurred.
StatusSignal< units::length::meter_t > & GetDistanceStdDev(bool refresh=true)
Standard Deviation of the distance measurement.
StatusSignal< bool > & GetIsProLicensed(bool refresh=true)
Whether the device is Phoenix Pro licensed.
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition CoreCANrange.hpp:1361
StatusSignal< bool > & GetStickyFault_BootDuringEnable(bool refresh=true)
Device boot while detecting the enable signal.
StatusSignal< units::angle::degree_t > & GetRealFOVCenterX(bool refresh=true)
The actual center of the FOV in the X direction.
StatusSignal< units::voltage::volt_t > & GetSupplyVoltage(bool refresh=true)
Measured supply voltage to the CANrange.
StatusSignal< units::length::meter_t > & GetDistance(bool refresh=true)
Distance to the nearest object in the configured field of view of the CANrange.
StatusSignal< int > & GetStickyFaultField(bool refresh=true)
Integer representing all (persistent) sticky fault flags reported by the device.
StatusSignal< signals::MeasurementHealthValue > & GetMeasurementHealth(bool refresh=true)
Health of the distance measurement.
StatusSignal< int > & GetVersion(bool refresh=true)
Full Version of firmware in device.
CoreCANrange(int deviceId, CANBus canbus)
Constructs a new CANrange object.
Definition CoreCANrange.hpp:755
configs::CANrangeConfigurator const & GetConfigurator() const
Gets the configurator for this CANrange.
Definition CoreCANrange.hpp:778
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable()
Clear sticky fault: Device boot while detecting the enable signal.
Definition CoreCANrange.hpp:1431
ctre::phoenix::StatusCode ClearStickyFault_Hardware()
Clear sticky fault: Hardware fault occurred.
Definition CoreCANrange.hpp:1383
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage()
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CoreCANrange.hpp:1407
StatusSignal< int > & GetVersionMinor(bool refresh=true)
App Minor Version number.
configs::CANrangeConfigurator & GetConfigurator()
Gets the configurator for this CANrange.
Definition CoreCANrange.hpp:766
StatusSignal< units::angle::degree_t > & GetRealFOVRangeX(bool refresh=true)
The actual range of the FOV in the X direction.
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse(units::time::second_t timeoutSeconds)
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CoreCANrange.hpp:1443
StatusSignal< units::dimensionless::scalar_t > & GetAmbientSignal(bool refresh=true)
The amount of ambient infrared light that the sensor is detecting.
Class to control the state of a simulated hardware::CANrange.
Definition CANrangeSimState.hpp:30
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
static constexpr int OK
No Error.
Definition StatusCodes.h:34
static constexpr int NotSupported
This is not supported.
Definition StatusCodes.h:652
Definition StatusCodes.h:18