CTRE Phoenix 6 C++ 24.3.0
ctre::phoenix6::signals::FeedbackSensorSourceValue Class Reference

Choose what sensor source is reported via API and used by closed-loop and limit features. More...

#include <ctre/phoenix6/signals/SpnEnums.hpp>

Inheritance diagram for ctre::phoenix6::signals::FeedbackSensorSourceValue:
ctre::phoenix6::ISerializable

Public Member Functions

 FeedbackSensorSourceValue (int value)
 
 FeedbackSensorSourceValue ()
 
std::string ToString () const
 Gets the string representation of this enum. More...
 
std::string Serialize () const
 
bool operator== (const FeedbackSensorSourceValue &data) const
 
bool operator== (int data) const
 
bool operator< (const FeedbackSensorSourceValue &data) const
 
bool operator< (int data) const
 
virtual std::string Serialize () const =0
 

Public Attributes

int value
 

Static Public Attributes

static constexpr int RotorSensor = 0
 
static constexpr int RemoteCANcoder = 1
 
static constexpr int RemotePigeon2_Yaw = 2
 
static constexpr int RemotePigeon2_Pitch = 3
 
static constexpr int RemotePigeon2_Roll = 4
 
static constexpr int FusedCANcoder = 5
 
static constexpr int SyncCANcoder = 6
 

Friends

std::ostream & operator<< (std::ostream &os, const FeedbackSensorSourceValue &data)
 

Detailed Description

Choose what sensor source is reported via API and used by closed-loop and limit features.

The default is RotorSensor, which uses the internal rotor sensor in the Talon FX.

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position and velocity whenever CANcoder publishes its information on CAN bus.

Choose FusedCANcoder (requires Phoenix Pro) and Talon FX will fuse another CANcoder's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). FusedCANcoder was developed for applications such as swerve-azimuth.

Choose SyncCANcoder (requires Phoenix Pro) and Talon FX will synchronize its internal rotor position against another CANcoder, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The TalonFX will report if its internal position differs significantly from the reported CANcoder position. SyncCANcoder was developed for mechanisms where there is a risk of the CANcoder failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll to use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon FX position will be in rotations and not degrees.

Note: When the feedback source is changed to FusedCANcoder, the Talon FX needs a period of time to fuse before sensor-based (soft-limit, closed loop, etc.) features are used. This period of time is determined by the update frequency of the CANcoder's Position signal.

Constructor & Destructor Documentation

◆ FeedbackSensorSourceValue() [1/2]

ctre::phoenix6::signals::FeedbackSensorSourceValue::FeedbackSensorSourceValue ( int  value)
inline

◆ FeedbackSensorSourceValue() [2/2]

ctre::phoenix6::signals::FeedbackSensorSourceValue::FeedbackSensorSourceValue ( )
inline

Member Function Documentation

◆ operator<() [1/2]

bool ctre::phoenix6::signals::FeedbackSensorSourceValue::operator< ( const FeedbackSensorSourceValue data) const
inline

◆ operator<() [2/2]

bool ctre::phoenix6::signals::FeedbackSensorSourceValue::operator< ( int  data) const
inline

◆ operator==() [1/2]

bool ctre::phoenix6::signals::FeedbackSensorSourceValue::operator== ( const FeedbackSensorSourceValue data) const
inline

◆ operator==() [2/2]

bool ctre::phoenix6::signals::FeedbackSensorSourceValue::operator== ( int  data) const
inline

◆ Serialize()

std::string ctre::phoenix6::signals::FeedbackSensorSourceValue::Serialize ( ) const
inlinevirtual

◆ ToString()

std::string ctre::phoenix6::signals::FeedbackSensorSourceValue::ToString ( ) const
inline

Gets the string representation of this enum.

Returns
String representation of this enum

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const FeedbackSensorSourceValue data 
)
friend

Member Data Documentation

◆ FusedCANcoder

constexpr int ctre::phoenix6::signals::FeedbackSensorSourceValue::FusedCANcoder = 5
staticconstexpr

◆ RemoteCANcoder

constexpr int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemoteCANcoder = 1
staticconstexpr

◆ RemotePigeon2_Pitch

constexpr int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemotePigeon2_Pitch = 3
staticconstexpr

◆ RemotePigeon2_Roll

constexpr int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemotePigeon2_Roll = 4
staticconstexpr

◆ RemotePigeon2_Yaw

constexpr int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemotePigeon2_Yaw = 2
staticconstexpr

◆ RotorSensor

constexpr int ctre::phoenix6::signals::FeedbackSensorSourceValue::RotorSensor = 0
staticconstexpr

◆ SyncCANcoder

constexpr int ctre::phoenix6::signals::FeedbackSensorSourceValue::SyncCANcoder = 6
staticconstexpr

◆ value

int ctre::phoenix6::signals::FeedbackSensorSourceValue::value

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