14#include <units/angle.h>
15#include <units/angular_velocity.h>
16#include <units/dimensionless.h>
17#include <units/voltage.h>
98 ctre::phoenix::StatusCode
Deserialize(
const std::string& to_deserialize)
263 ctre::phoenix::StatusCode
SetPosition(units::angle::turn_t newValue)
280 ctre::phoenix::StatusCode
SetPosition(units::angle::turn_t newValue, units::time::second_t timeoutSeconds)
282 std::stringstream ss;
327 std::stringstream ss;
364 std::stringstream ss;
403 std::stringstream ss;
442 std::stringstream ss;
481 std::stringstream ss;
549 std::unique_ptr<sim::CANcoderSimState> _simState{};
562 if (_simState ==
nullptr)
563 _simState = std::make_unique<sim::CANcoderSimState>(*
this);
984 ctre::phoenix::StatusCode
SetPosition(units::angle::turn_t newValue, units::time::second_t timeoutSeconds)
996 ctre::phoenix::StatusCode
SetPosition(units::angle::turn_t newValue)
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)
@ OK
No Error.
Definition: StatusCodes.h:1192
@ NotSupported
This is not supported.
Definition: StatusCodes.h:1805
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along w...
Definition: CoreCANcoder.hpp:37
MagnetSensorConfigs MagnetSensor
Configs that affect the magnet sensor and how to interpret it.
Definition: CoreCANcoder.hpp:61
ctre::phoenix::StatusCode Deserialize(const std::string &to_deserialize)
Take a string and deserialize it to this configuration.
Definition: CoreCANcoder.hpp:98
bool FutureProofConfigs
True if we should factory default newer unsupported configs, false to leave newer unsupported configs...
Definition: CoreCANcoder.hpp:52
CANcoderConfiguration & WithMagnetSensor(MagnetSensorConfigs newMagnetSensor)
Modifies this configuration's MagnetSensor parameter and returns itself for method-chaining and easie...
Definition: CoreCANcoder.hpp:69
std::string ToString() const
Get the string representation of this configuration.
Definition: CoreCANcoder.hpp:78
std::string Serialize() const
Get the serialized form of this configuration.
Definition: CoreCANcoder.hpp:88
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along w...
Definition: CoreCANcoder.hpp:113
ctre::phoenix::StatusCode Refresh(MagnetSensorConfigs &configs) const
Refreshes the values of the specified config group.
Definition: CoreCANcoder.hpp:198
ctre::phoenix::StatusCode ClearStickyFault_BadMagnet()
Clear sticky fault: The magnet distance is not correct or magnet is missing.
Definition: CoreCANcoder.hpp:462
ctre::phoenix::StatusCode ClearStickyFault_BadMagnet(units::time::second_t timeoutSeconds)
Clear sticky fault: The magnet distance is not correct or magnet is missing.
Definition: CoreCANcoder.hpp:479
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage()
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition: CoreCANcoder.hpp:384
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable()
Clear sticky fault: Device boot while detecting the enable signal.
Definition: CoreCANcoder.hpp:423
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable(units::time::second_t timeoutSeconds)
Clear sticky fault: Device boot while detecting the enable signal.
Definition: CoreCANcoder.hpp:440
ctre::phoenix::StatusCode SetPosition(units::angle::turn_t newValue)
Sets the current position of the device.
Definition: CoreCANcoder.hpp:263
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition: CoreCANcoder.hpp:305
ctre::phoenix::StatusCode Apply(const CANcoderConfiguration &configs)
Applies the contents of the specified config to the device.
Definition: CoreCANcoder.hpp:168
ctre::phoenix::StatusCode Apply(const CANcoderConfiguration &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition: CoreCANcoder.hpp:182
ctre::phoenix::StatusCode Refresh(CANcoderConfiguration &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition: CoreCANcoder.hpp:150
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(units::time::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition: CoreCANcoder.hpp:401
ctre::phoenix::StatusCode Apply(const MagnetSensorConfigs &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition: CoreCANcoder.hpp:243
ctre::phoenix::StatusCode ClearStickyFault_Hardware()
Clear sticky fault: Hardware fault occurred.
Definition: CoreCANcoder.hpp:346
ctre::phoenix::StatusCode Refresh(CANcoderConfiguration &configs) const
Refreshes the values of the specified config group.
Definition: CoreCANcoder.hpp:136
ctre::phoenix::StatusCode ClearStickyFault_Hardware(units::time::second_t timeoutSeconds)
Clear sticky fault: Hardware fault occurred.
Definition: CoreCANcoder.hpp:362
ctre::phoenix::StatusCode ClearStickyFaults(units::time::second_t timeoutSeconds)
Clear the sticky faults in the device.
Definition: CoreCANcoder.hpp:325
ctre::phoenix::StatusCode Refresh(MagnetSensorConfigs &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition: CoreCANcoder.hpp:211
ctre::phoenix::StatusCode SetPosition(units::angle::turn_t newValue, units::time::second_t timeoutSeconds)
Sets the current position of the device.
Definition: CoreCANcoder.hpp:280
CANcoderConfigurator(const CANcoderConfigurator &)=delete
Delete the copy constructor, we can only pass by reference.
ctre::phoenix::StatusCode Apply(const MagnetSensorConfigs &configs)
Applies the contents of the specified config to the device.
Definition: CoreCANcoder.hpp:229
Configs that affect the magnet sensor and how to interpret it.
Definition: Configs.hpp:46
std::string Serialize() const override
Definition: Configs.hpp:121
ctre::phoenix::StatusCode Deserialize(const std::string &to_deserialize) override
Definition: Configs.hpp:131
std::string ToString() const override
Definition: Configs.hpp:109
Definition: Configs.hpp:27
Definition: Configurator.hpp:21
ctre::phoenix::StatusCode SetConfigsPrivate(const std::string &serializedString, units::time::second_t timeoutSeconds, bool futureProofConfigs, bool overrideIfDuplicate)
Definition: Configurator.hpp:37
ctre::phoenix::StatusCode GetConfigsPrivate(std::string &serializedString, units::time::second_t timeoutSeconds) const
Definition: Configurator.hpp:60
units::time::second_t DefaultTimeoutSeconds
The default amount of time to wait for a config.
Definition: Configurator.hpp:26
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:28
Definition: DeviceIdentifier.hpp:19
Parent class for all devices.
Definition: ParentDevice.hpp:29
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along w...
Definition: CoreCANcoder.hpp:498
StatusSignal< bool > & GetFault_UnlicensedFeatureInUse()
An unlicensed feature is in use, device may not behave as expected.
ctre::phoenix::StatusCode ClearStickyFaults(units::time::second_t timeoutSeconds)
Clear the sticky faults in the device.
Definition: CoreCANcoder.hpp:1011
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage()
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition: CoreCANcoder.hpp:1072
StatusSignal< int > & GetVersionBugfix()
App Bugfix Version number.
StatusSignal< bool > & GetStickyFault_Hardware()
Hardware fault occurred.
StatusSignal< units::angular_velocity::turns_per_second_t > & GetUnfilteredVelocity()
The unfiltered velocity reported by CANcoder.
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition: CoreCANcoder.hpp:1026
configs::CANcoderConfigurator & GetConfigurator()
Gets the configurator for this CANcoder.
Definition: CoreCANcoder.hpp:530
CoreCANcoder(int deviceId, std::string canbus="")
Constructs a new CANcoder object.
StatusSignal< int > & GetStickyFaultField()
Integer representing all sticky faults.
StatusSignal< bool > & GetFault_BadMagnet()
The magnet distance is not correct or magnet is missing.
StatusSignal< units::angle::turn_t > & GetPosition()
Position of the device.
ctre::phoenix::StatusCode ClearStickyFault_Hardware(units::time::second_t timeoutSeconds)
Clear sticky fault: Hardware fault occurred.
Definition: CoreCANcoder.hpp:1037
StatusSignal< int > & GetVersionBuild()
App Build Version number.
StatusSignal< bool > & GetFault_Undervoltage()
Device supply voltage dropped to near brownout levels.
StatusSignal< int > & GetVersionMinor()
App Minor Version number.
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(units::time::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition: CoreCANcoder.hpp:1060
CoreCANcoder & operator=(CoreCANcoder const &)=delete
ctre::phoenix::StatusCode SetPosition(units::angle::turn_t newValue)
Sets the current position of the device.
Definition: CoreCANcoder.hpp:996
StatusSignal< units::angular_velocity::turns_per_second_t > & GetVelocity()
Velocity of the device.
sim::CANcoderSimState & GetSimState()
Get the simulation state for this device.
Definition: CoreCANcoder.hpp:560
ctre::phoenix::StatusCode ClearStickyFault_BadMagnet()
Clear sticky fault: The magnet distance is not correct or magnet is missing.
Definition: CoreCANcoder.hpp:1120
ctre::phoenix::StatusCode SetControl(controls::ControlRequest &request)
Control motor with generic control request object.
Definition: CoreCANcoder.hpp:955
CoreCANcoder(CoreCANcoder const &)=delete
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable(units::time::second_t timeoutSeconds)
Clear sticky fault: Device boot while detecting the enable signal.
Definition: CoreCANcoder.hpp:1084
StatusSignal< bool > & GetIsProLicensed()
Whether the device is Phoenix Pro licensed.
StatusSignal< signals::MagnetHealthValue > & GetMagnetHealth()
Magnet health as measured by CANcoder.
StatusSignal< bool > & GetStickyFault_BadMagnet()
The magnet distance is not correct or magnet is missing.
StatusSignal< int > & GetVersion()
Full Version.
StatusSignal< units::voltage::volt_t > & GetSupplyVoltage()
Measured supply voltage to the CANcoder.
StatusSignal< units::angle::turn_t > & GetPositionSinceBoot()
The relative position reported by the CANcoder since boot.
StatusSignal< int > & GetFaultField()
Integer representing all faults.
StatusSignal< bool > & GetStickyFault_BootDuringEnable()
Device boot while detecting the enable signal.
ctre::phoenix::StatusCode ClearStickyFault_BadMagnet(units::time::second_t timeoutSeconds)
Clear sticky fault: The magnet distance is not correct or magnet is missing.
Definition: CoreCANcoder.hpp:1108
StatusSignal< bool > & GetFault_BootDuringEnable()
Device boot while detecting the enable signal.
ctre::phoenix::StatusCode SetControl(controls::ControlRequest &&request)
Control motor with generic control request object.
Definition: CoreCANcoder.hpp:971
ctre::phoenix::StatusCode SetPosition(units::angle::turn_t newValue, units::time::second_t timeoutSeconds)
Sets the current position of the device.
Definition: CoreCANcoder.hpp:984
StatusSignal< bool > & GetStickyFault_UnlicensedFeatureInUse()
An unlicensed feature is in use, device may not behave as expected.
ctre::phoenix::StatusCode ClearStickyFault_Hardware()
Clear sticky fault: Hardware fault occurred.
Definition: CoreCANcoder.hpp:1048
StatusSignal< units::angle::turn_t > & GetAbsolutePosition()
Absolute Position of the device.
StatusSignal< int > & GetVersionMajor()
App Major Version number.
StatusSignal< bool > & GetFault_Hardware()
Hardware fault occurred.
configs::CANcoderConfigurator const & GetConfigurator() const
Gets the configurator for this CANcoder.
Definition: CoreCANcoder.hpp:542
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable()
Clear sticky fault: Device boot while detecting the enable signal.
Definition: CoreCANcoder.hpp:1096
StatusSignal< bool > & GetStickyFault_Undervoltage()
Device supply voltage dropped to near brownout levels.
Class to control the state of a simulated hardware::CANcoder.
Definition: CANcoderSimState.hpp:32
Definition: RcManualEvent.hpp:12