CTRE Phoenix Pro C++ 23.0.12
ctre::phoenixpro::signals::FeedbackSensorSourceValue Class Reference

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

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

Inheritance diagram for ctre::phoenixpro::signals::FeedbackSensorSourceValue:
ctre::phoenixpro::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 FusedCANcoder = 5
 

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 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 (note this requires setting FeedbackRemoteSensorID). FusedCANcoder was developed for applications such as swerve-azimuth.

Note: When the Talon Source is changed to FusedCANcoder, the Talon 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::phoenixpro::signals::FeedbackSensorSourceValue::FeedbackSensorSourceValue ( int  value)
inline

◆ FeedbackSensorSourceValue() [2/2]

ctre::phoenixpro::signals::FeedbackSensorSourceValue::FeedbackSensorSourceValue ( )
inline

Member Function Documentation

◆ operator<() [1/2]

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

◆ operator<() [2/2]

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

◆ operator==() [1/2]

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

◆ operator==() [2/2]

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

◆ Serialize()

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

◆ ToString()

std::string ctre::phoenixpro::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::phoenixpro::signals::FeedbackSensorSourceValue::FusedCANcoder = 5
staticconstexpr

◆ RemoteCANcoder

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

◆ RotorSensor

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

◆ value

int ctre::phoenixpro::signals::FeedbackSensorSourceValue::value

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